mirror of
https://github.com/bitwarden/browser
synced 2026-01-06 10:33:57 +00:00
[PM-23627] Require publicKey for keyService getFingerprint (#15933)
* require public key on keyService getFingerprint * Update consumers and add error handling & logging
This commit is contained in:
@@ -299,12 +299,22 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||
break;
|
||||
case "showFingerprintPhrase": {
|
||||
const activeUserId = await firstValueFrom(
|
||||
this.accountService.activeAccount$.pipe(map((a) => a?.id)),
|
||||
getUserId(this.accountService.activeAccount$),
|
||||
);
|
||||
const publicKey = await firstValueFrom(this.keyService.userPublicKey$(activeUserId));
|
||||
const fingerprint = await this.keyService.getFingerprint(activeUserId, publicKey);
|
||||
const dialogRef = FingerprintDialogComponent.open(this.dialogService, { fingerprint });
|
||||
await firstValueFrom(dialogRef.closed);
|
||||
if (publicKey == null) {
|
||||
this.logService.error(
|
||||
"[AppComponent] No public key available for the user: " +
|
||||
activeUserId +
|
||||
" fingerprint can't be displayed.",
|
||||
);
|
||||
} else {
|
||||
const fingerprint = await this.keyService.getFingerprint(activeUserId, publicKey);
|
||||
const dialogRef = FingerprintDialogComponent.open(this.dialogService, {
|
||||
fingerprint,
|
||||
});
|
||||
await firstValueFrom(dialogRef.closed);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "deleteAccount":
|
||||
|
||||
Reference in New Issue
Block a user