mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-19 01:51:27 +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> {
|
async getMasterKey(userId?: string): Promise<MasterKey> {
|
||||||
let masterKey = await this.stateService.getMasterKey({ userId: userId });
|
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;
|
return masterKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user