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:
@@ -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 &&
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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" },
|
||||
|
||||
Reference in New Issue
Block a user