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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user