mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
Update user last password change (#4685)
This commit is contained in:
parent
9a7165b489
commit
0ed1f5e2de
@ -327,7 +327,9 @@ public class EmergencyAccessService : IEmergencyAccessService
|
||||
|
||||
var grantor = await _userRepository.GetByIdAsync(emergencyAccess.GrantorId);
|
||||
|
||||
grantor.MasterPassword = _passwordHasher.HashPassword(grantor, newMasterPasswordHash);
|
||||
await _userService.UpdatePasswordHash(grantor, newMasterPasswordHash);
|
||||
grantor.RevisionDate = DateTime.UtcNow;
|
||||
grantor.LastPasswordChangeDate = grantor.RevisionDate;
|
||||
grantor.Key = key;
|
||||
// Disable TwoFactor providers since they will otherwise block logins
|
||||
grantor.SetTwoFactorProviders(new Dictionary<TwoFactorProviderType, TwoFactorProvider>());
|
||||
|
@ -713,8 +713,9 @@ public class UserService : UserManager<User>, IUserService, IDisposable
|
||||
}
|
||||
|
||||
user.RevisionDate = user.AccountRevisionDate = DateTime.UtcNow;
|
||||
user.Key = key;
|
||||
user.LastPasswordChangeDate = user.RevisionDate;
|
||||
user.ForcePasswordReset = true;
|
||||
user.Key = key;
|
||||
|
||||
await _userRepository.ReplaceAsync(user);
|
||||
await _mailService.SendAdminResetPasswordEmailAsync(user.Email, user.Name, org.DisplayName());
|
||||
|
Loading…
Reference in New Issue
Block a user