1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Added retrt logic to all documentdb queries. Updated change password and email process to use multi step for cirty ciphers and replace user. Fixed RefreshSecurityStampAsync to not dirty ciphers.

This commit is contained in:
Kyle Spearrin
2015-12-29 21:45:21 -05:00
parent 55be0c739e
commit 972290d1ec
15 changed files with 250 additions and 180 deletions

View File

@ -169,7 +169,8 @@ namespace Bit.Core.Services
user.MasterPassword = _passwordHasher.HashPassword(user, newMasterPassword);
user.SecurityStamp = Guid.NewGuid().ToString();
await _userRepository.ReplaceAndDirtyCiphersAsync(user);
await _cipherRepository.DirtyCiphersAsync(user.Id);
await _userRepository.ReplaceAsync(user);
await _cipherRepository.UpdateDirtyCiphersAsync(ciphers);
// TODO: what if something fails? rollback?
@ -197,7 +198,8 @@ namespace Bit.Core.Services
return result;
}
await _userRepository.ReplaceAndDirtyCiphersAsync(user);
await _cipherRepository.DirtyCiphersAsync(user.Id);
await _userRepository.ReplaceAsync(user);
await _cipherRepository.UpdateDirtyCiphersAsync(ciphers);
// TODO: what if something fails? rollback?
@ -224,7 +226,7 @@ namespace Bit.Core.Services
return result;
}
await _userRepository.ReplaceAndDirtyCiphersAsync(user);
await _userRepository.ReplaceAsync(user);
return IdentityResult.Success;
}