1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-05 03:03:26 +00:00

Update fido2-vault and fido2-service implementations

This commit is contained in:
Jeffrey Holland
2025-08-20 14:01:22 +02:00
parent fca0c8e7ad
commit 69d24d29c2
2 changed files with 21 additions and 16 deletions

View File

@@ -120,16 +120,26 @@ export class Fido2VaultComponent implements OnInit, OnDestroy {
return;
}
this.cipherIds$.pipe(takeUntil(this.destroy$)).subscribe((cipherIds) => {
this.cipherService
.getAllDecryptedForIds(activeUserId, cipherIds || [])
.then((ciphers) => {
this.ciphersSubject.next(ciphers.filter((cipher) => !cipher.deletedDate));
})
.catch((error) => {
this.logService.error("Failed to load ciphers", error);
});
});
// Combine cipher list with optional cipher IDs filter
combineLatest([this.cipherService.cipherListViews$(activeUserId), this.cipherIds$ || of(null)])
.pipe(
map(([ciphers, cipherIds]) => {
// Filter out deleted ciphers
const activeCiphers = ciphers.filter((cipher) => !cipher.deletedDate);
// If specific IDs provided, filter by them
if (cipherIds?.length > 0) {
return activeCiphers.filter((cipher) => cipherIds.includes(cipher.id));
}
return activeCiphers;
}),
takeUntil(this.destroy$),
)
.subscribe({
next: (ciphers) => this.ciphersSubject.next(ciphers as CipherView[]),
error: (error: unknown) => this.logService.error("Failed to load ciphers", error),
});
}
private async validateCipherAccess(cipher: CipherView): Promise<boolean> {

View File

@@ -157,12 +157,7 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
}
async getRpId(): Promise<string> {
return lastValueFrom(
this.rpId.pipe(
filter((id) => id != null),
take(1),
),
);
return firstValueFrom(this.rpId.pipe(filter((id) => id != null)));
}
confirmChosenCipher(cipherId: string, userVerified: boolean = false): void {