removes remaining back office things from underlying UmbracoUserManager moves files

This commit is contained in:
Shannon
2020-12-04 02:21:21 +11:00
parent aeec18d808
commit 86d231f5de
37 changed files with 111 additions and 230 deletions

View File

@@ -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;
}
}
}