1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 15:53:44 +00:00

[PM-3543] [PM-3607] Fix password re-prompt when editing and on autofill. (#2713)

* [PM-3543] [PM-3507] Fix password re-prompt when editing and on autofill.
This commit is contained in:
André Bispo
2023-08-30 09:38:46 +01:00
committed by GitHub
parent 68759fc608
commit 4d0f9d1c03
5 changed files with 32 additions and 4 deletions

View File

@@ -700,6 +700,15 @@ namespace Bit.Core.Services
return new EncByteArray(encBytes);
}
public async Task<MasterKey> GetOrDeriveMasterKeyAsync(string password, string userId = null)
{
var masterKey = await GetMasterKeyAsync(userId);
return masterKey ?? await this.MakeMasterKeyAsync(
password,
await _stateService.GetEmailAsync(userId),
await _stateService.GetActiveUserCustomDataAsync(a => new KdfConfig(a?.Profile)));
}
// --HELPER METHODS--
private async Task StoreAdditionalKeysAsync(UserKey userKey, string userId = null)