mirror of
https://github.com/bitwarden/server
synced 2025-12-28 06:03:29 +00:00
If no ciphers yet, just save user when changing password/email
This commit is contained in:
@@ -142,7 +142,16 @@ namespace Bit.Core.Services
|
||||
user.Email = newEmail;
|
||||
user.EmailVerified = true;
|
||||
user.RevisionDate = DateTime.UtcNow;
|
||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||
|
||||
if(ciphers.Any())
|
||||
{
|
||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _userRepository.ReplaceAsync(user);
|
||||
}
|
||||
|
||||
return IdentityResult.Success;
|
||||
}
|
||||
|
||||
@@ -167,7 +176,15 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
user.RevisionDate = DateTime.UtcNow;
|
||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||
if(ciphers.Any())
|
||||
{
|
||||
await _cipherRepository.UpdateUserEmailPasswordAndCiphersAsync(user, ciphers);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _userRepository.ReplaceAsync(user);
|
||||
}
|
||||
|
||||
return IdentityResult.Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user