1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 20:24:01 +00:00

[PM-3807] Store passkeys as array (#6288)

* [PM-3807] feat: store passkeys as array

* [PM-3807] fix: issues in views

* [PM-3807] fix: additional view bugs

* [PM-3807] fix: check array length

* [PM-3807] fix: I secretly like build errors
This commit is contained in:
Andreas Coroiu
2023-09-15 09:45:54 +02:00
committed by GitHub
parent dbbbae2f52
commit 7c4e1f9992
20 changed files with 209 additions and 171 deletions

View File

@@ -140,15 +140,15 @@ export class ShareComponent implements OnInit, OnDestroy {
}
private async checkFido2KeyExistsInOrg(cipher: CipherView, orgId: string): Promise<boolean> {
if (cipher.type === CipherType.Fido2Key || cipher.login?.fido2Key) {
if (cipher.type === CipherType.Fido2Key || cipher.login?.fido2Keys[0]) {
//Determine if Fido2Key object is disvoverable or non discoverable
const newFido2Key = cipher.login?.fido2Key || cipher.fido2Key;
const newFido2Key = cipher.login?.fido2Keys[0] || cipher.fido2Key;
const ciphers = await this.cipherService.getAllDecrypted();
const exisitingOrgCiphers = ciphers.filter((c) => c.organizationId === orgId);
return exisitingOrgCiphers.some((c) => {
const existingFido2key = c.login?.fido2Key || c.fido2Key;
const existingFido2key = c.login?.fido2Keys[0] || c.fido2Key;
return (
!c.isDeleted &&

View File

@@ -323,8 +323,8 @@ export class AddEditComponent implements OnInit, OnDestroy {
if (this.cloneMode) {
this.cipher.id = null;
if (this.cipher.type === CipherType.Login && this.cipher.login.fido2Key) {
this.cipher.login.fido2Key = null;
if (this.cipher.type === CipherType.Login && this.cipher.login.fido2Keys.length > 0) {
this.cipher.login.fido2Keys = [];
}
}

View File

@@ -155,7 +155,7 @@ export class ViewComponent implements OnDestroy, OnInit {
}
async clone() {
if (this.cipher.login?.fido2Key) {
if (this.cipher.login?.fido2Keys.length > 0) {
const confirmed = await this.dialogService.openSimpleDialog({
title: { key: "passkeyNotCopied" },
content: { key: "passkeyNotCopiedAlert" },