diff --git a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts index a8103a99972..765ccabe0fd 100644 --- a/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts +++ b/apps/desktop/src/autofill/services/desktop-fido2-user-interface.service.ts @@ -95,8 +95,7 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi private confirmCredentialSubject = new Subject(); - private createdCipher: Cipher = new Cipher(); - private updatedCipher: CipherView = new CipherView(); + private updatedCipher: CipherView; private rpId = new BehaviorSubject(""); private availableCipherIdsSubject = new BehaviorSubject([""]); @@ -238,14 +237,14 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi return { cipherId: this.updatedCipher.id, userVerified: userVerification }; } else { // Create the credential - await this.createCipher({ + const createdCipher = await this.createCipher({ credentialName, userName, rpId, userHandle, userVerification, }); - return { cipherId: this.createdCipher.id, userVerified: userVerification }; + return { cipherId: createdCipher.id, userVerified: userVerification }; } } finally { // Make sure to clean up so the app is never stuck in modal mode? @@ -306,7 +305,6 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi try { const createdCipher = await this.cipherService.createWithServer(encCipher); - this.createdCipher = createdCipher; return createdCipher; } catch {