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:
parent
07ed368c24
commit
3e11a9b092
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user