1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-13 23:13:36 +00:00

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.
This commit is contained in:
Todd Martin
2023-10-11 17:38:53 -04:00
committed by GitHub
parent a10a53aa15
commit 80c94bf9b7
14 changed files with 27 additions and 24 deletions

View File

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

View File

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