mirror of
https://github.com/bitwarden/mobile
synced 2025-12-17 08:43:21 +00:00
Added GetOrDeriveMasterKey to UserVerificationService (#2808)
This commit is contained in:
@@ -719,6 +719,17 @@ namespace Bit.Core.Services
|
||||
await _stateService.GetActiveUserCustomDataAsync(a => new KdfConfig(a?.Profile)));
|
||||
}
|
||||
|
||||
public async Task UpdateMasterKeyAndUserKeyAsync(MasterKey masterKey)
|
||||
{
|
||||
var userKey = await DecryptUserKeyWithMasterKeyAsync(masterKey);
|
||||
await SetMasterKeyAsync(masterKey);
|
||||
var hasKey = await HasUserKeyAsync();
|
||||
if (!hasKey)
|
||||
{
|
||||
await SetUserKeyAsync(userKey);
|
||||
}
|
||||
}
|
||||
|
||||
// --HELPER METHODS--
|
||||
|
||||
private async Task StoreAdditionalKeysAsync(UserKey userKey, string userId = null)
|
||||
|
||||
Reference in New Issue
Block a user