1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Encourage The Use of UserId in CryptoService (#9033)

This commit is contained in:
Justin Baur
2024-05-04 02:04:56 -04:00
committed by GitHub
parent e4ef7d362e
commit 869fa29da6
16 changed files with 92 additions and 49 deletions

View File

@@ -116,9 +116,13 @@ export class UserApiLoginStrategy extends LoginStrategy {
}
}
protected override async setPrivateKey(response: IdentityTokenResponse): Promise<void> {
protected override async setPrivateKey(
response: IdentityTokenResponse,
userId: UserId,
): Promise<void> {
await this.cryptoService.setPrivateKey(
response.privateKey ?? (await this.createKeyPairForOldAccount()),
response.privateKey ?? (await this.createKeyPairForOldAccount(userId)),
userId,
);
}