mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-19172] Passes UserId through change email component and adds tests (#13686)
* add tests and pass userid * add tests for getOrDeriveMasterKey * remove extra coalesce for token
This commit is contained in:
@@ -287,10 +287,15 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
),
|
||||
);
|
||||
const masterKey = await firstValueFrom(this.masterPasswordService.masterKey$(resolvedUserId));
|
||||
return (
|
||||
masterKey ||
|
||||
(await this.makeMasterKey(password, email, await this.kdfConfigService.getKdfConfig()))
|
||||
);
|
||||
if (masterKey != null) {
|
||||
return masterKey;
|
||||
}
|
||||
|
||||
const kdf = await firstValueFrom(this.kdfConfigService.getKdfConfig$(resolvedUserId));
|
||||
if (kdf == null) {
|
||||
throw new Error("No kdf found for user");
|
||||
}
|
||||
return await this.makeMasterKey(password, email, kdf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user