public void ChangeEasyPassword(User user, string newPassword, string?newPasswordSha1) { GetAuthenticationProvider(user).ChangeEasyPassword(user, newPassword, newPasswordSha1); UpdateUser(user); OnUserPasswordChanged?.Invoke(this, new GenericEventArgs <User>(user)); }
public async Task ChangePassword(User user, string newPassword) { if (user == null) { throw new ArgumentNullException(nameof(user)); } await GetAuthenticationProvider(user).ChangePassword(user, newPassword).ConfigureAwait(false); await UpdateUserAsync(user).ConfigureAwait(false); OnUserPasswordChanged?.Invoke(this, new GenericEventArgs <User>(user)); }
public void ChangeEasyPassword(User user, string newPassword, string?newPasswordSha1) { if (newPassword != null) { newPasswordSha1 = _cryptoProvider.CreatePasswordHash(newPassword).ToString(); } if (string.IsNullOrWhiteSpace(newPasswordSha1)) { throw new ArgumentNullException(nameof(newPasswordSha1)); } user.EasyPassword = newPasswordSha1; UpdateUser(user); OnUserPasswordChanged?.Invoke(this, new GenericEventArgs <User>(user)); }