From 80c94bf9b7fd59b3e568bed7bf32436505dec135 Mon Sep 17 00:00:00 2001 From: Todd Martin <106564991+trmartin4@users.noreply.github.com> Date: Wed, 11 Oct 2023 17:38:53 -0400 Subject: [PATCH] Updated fido2Credentials to initialize as null instead of empty array (#6548) * Updated fido2Credentials to be null instead of empty string * Updated cipher tests. * Fixed tests. * Updated view and clone logic. * Updated templates to handle null value. * Further null checks. --- .../src/vault/popup/components/fido2/fido2.component.ts | 2 +- .../vault/popup/components/vault/add-edit.component.html | 2 +- .../src/vault/popup/components/vault/view.component.html | 2 +- apps/desktop/src/vault/app/vault/add-edit.component.html | 2 +- apps/desktop/src/vault/app/vault/view.component.html | 2 +- .../app/vault/individual-vault/add-edit.component.html | 2 +- .../src/app/vault/individual-vault/vault.component.ts | 2 +- libs/angular/src/vault/components/add-edit.component.ts | 4 ++-- libs/angular/src/vault/components/view.component.ts | 2 +- libs/common/src/vault/models/domain/cipher.spec.ts | 2 -- libs/common/src/vault/models/domain/login.spec.ts | 5 +---- libs/common/src/vault/models/domain/login.ts | 9 +++++++-- libs/common/src/vault/models/view/login.view.ts | 9 ++++++--- .../vault/services/fido2/fido2-authenticator.service.ts | 6 +++--- 14 files changed, 27 insertions(+), 24 deletions(-) diff --git a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts index 7ee9e959f0e5..91fb2d29aa9d 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2.component.ts @@ -235,7 +235,7 @@ export class Fido2Component implements OnInit, OnDestroy { } else if (data?.type === "ConfirmNewCredentialRequest") { let userVerified = false; - if (this.cipher.login.fido2Credentials.length > 0) { + if (this.cipher.login.hasFido2Credentials) { const confirmed = await this.dialogService.openSimpleDialog({ title: { key: "overwritePasskey" }, content: { key: "overwritePasskeyAlert" }, diff --git a/apps/browser/src/vault/popup/components/vault/add-edit.component.html b/apps/browser/src/vault/popup/components/vault/add-edit.component.html index 600633f01491..b2a42776e18a 100644 --- a/apps/browser/src/vault/popup/components/vault/add-edit.component.html +++ b/apps/browser/src/vault/popup/components/vault/add-edit.component.html @@ -131,7 +131,7 @@