removes remaining back office things from underlying UmbracoUserManager moves files
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Umbraco.Core.Security;
|
||||
|
||||
namespace Umbraco.Core.Security
|
||||
{
|
||||
public class BackOfficeUserValidator<T> : UserValidator<T>
|
||||
where T : BackOfficeIdentityUser
|
||||
{
|
||||
public override async Task<IdentityResult> ValidateAsync(UserManager<T> manager, T user)
|
||||
{
|
||||
// Don't validate if the user's email or username hasn't changed otherwise it's just wasting SQL queries.
|
||||
if (user.IsPropertyDirty("Email") || user.IsPropertyDirty("UserName"))
|
||||
{
|
||||
return await base.ValidateAsync(manager, user);
|
||||
}
|
||||
return IdentityResult.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user