public virtual async Task <IdentityResult> ChangePasswordAsync(TUser user, string newPassword) { var result = await PasswordValidator.ValidateAsync(newPassword); if (!result.Succeeded) { return(result); } await CodeZeroStore.SetPasswordHashAsync(user, PasswordHasher.HashPassword(newPassword)); return(IdentityResult.Success); }
public virtual async Task <IdentityResult> ChangePasswordAsync(TUser user, string newPassword) { var errors = new List <IdentityError>(); foreach (var validator in PasswordValidators) { var validationResult = await validator.ValidateAsync(this, user, newPassword); if (!validationResult.Succeeded) { errors.AddRange(validationResult.Errors); } } if (errors.Any()) { return(IdentityResult.Failed(errors.ToArray())); } await CodeZeroStore.SetPasswordHashAsync(user, PasswordHasher.HashPassword(user, newPassword)); return(IdentityResult.Success); }
private Task <TRole> FindByDisplayNameAsync(string displayName) { return(CodeZeroStore.FindByDisplayNameAsync(displayName)); }
protected virtual Task <string> GetOldUserNameAsync(long userId) { return(CodeZeroStore.GetUserNameFromDatabaseAsync(userId)); }
public virtual Task <TUser> FindByNameOrEmailAsync(int?tenantId, string userNameOrEmailAddress) { return(CodeZeroStore.FindByNameOrEmailAsync(tenantId, userNameOrEmailAddress)); }
public virtual Task <TUser> FindAsync(int?tenantId, UserLoginInfo login) { return(CodeZeroStore.FindAsync(tenantId, login)); }
public virtual Task <List <TUser> > FindAllAsync(UserLoginInfo login) { return(CodeZeroStore.FindAllAsync(login)); }
public virtual Task <TUser> FindByNameOrEmailAsync(string userNameOrEmailAddress) { return(CodeZeroStore.FindByNameOrEmailAsync(userNameOrEmailAddress)); }