mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
If no ciphers yet, just save user when changing password/email
This commit is contained in:
parent
3521646489
commit
c954683133
1
.gitignore
vendored
1
.gitignore
vendored
@ -198,3 +198,4 @@ FakesAssemblies/
|
||||
|
||||
# Other
|
||||
project.lock.json
|
||||
*.jfm
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user