1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-14 01:01:31 +01:00

migrate master key if found

This commit is contained in:
Jacob Fink 2023-06-26 16:42:34 -04:00
parent 07ed368c24
commit 3e11a9b092
No known key found for this signature in database
GPG Key ID: C2F7ACF05859D008

View File

@ -149,7 +149,10 @@ export class CryptoService implements CryptoServiceAbstraction {
async getMasterKey(userId?: string): Promise<MasterKey> {
let masterKey = await this.stateService.getMasterKey({ userId: userId });
masterKey ||= (await this.stateService.getCryptoMasterKey({ userId: userId })) as MasterKey;
if (!masterKey) {
masterKey = (await this.stateService.getCryptoMasterKey({ userId: userId })) as MasterKey;
await this.setMasterKey(masterKey, userId);
}
return masterKey;
}