1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 09:43:23 +00:00

[EC-598] feat: add basic support for managing passkeys

This commit is contained in:
Andreas Coroiu
2023-01-04 13:39:06 +01:00
parent 1eab09b79d
commit 6c7548c7ec
7 changed files with 46 additions and 5 deletions

View File

@@ -78,6 +78,8 @@ export class CipherView implements View, InitializerMetadata {
return this.card;
case CipherType.Identity:
return this.identity;
case CipherType.Fido2Key:
return this.fido2Key;
default:
break;
}

View File

@@ -1,6 +1,12 @@
export class Fido2KeyView {
import { ItemView } from "./item.view";
export class Fido2KeyView extends ItemView {
key: string;
rpId: string;
origin: string;
userHandle: string;
get subTitle(): string {
return null;
}
}

View File

@@ -172,6 +172,10 @@ export class Fido2Service implements Fido2ServiceAbstraction {
for (const allowedCredential of allowedCredentialIds) {
cipher = await this.cipherService.get(allowedCredential);
if (cipher.deletedDate != undefined) {
cipher = undefined;
}
if (cipher != undefined) {
break;
}
@@ -211,7 +215,7 @@ export class Fido2Service implements Fido2ServiceAbstraction {
private async getCredentialByRp(rpId: string): Promise<BitCredential | undefined> {
const allCipherViews = await this.cipherService.getAllDecrypted();
const cipherView = allCipherViews.find(
(cv) => cv.type === CipherType.Fido2Key && cv.fido2Key?.rpId === rpId
(cv) => !cv.isDeleted && cv.type === CipherType.Fido2Key && cv.fido2Key?.rpId === rpId
);
if (cipherView == undefined) {