diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 924bc2dd30f..25d5bcff7d0 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -86,7 +86,7 @@ const SyncInterval = 6 * 60 * 60 * 1000; // 6 hours - +
@@ -112,6 +112,7 @@ export class AppComponent implements OnInit, OnDestroy { @ViewChild("loginApproval", { read: ViewContainerRef, static: true }) loginApprovalModalRef: ViewContainerRef; + showHeader$ = this.accountService.showHeader$; loading = false; private lastActivity: Date = null; 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 765ccabe0fd..35ac1fe9571 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 @@ -97,7 +97,7 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi private updatedCipher: CipherView; - private rpId = new BehaviorSubject(""); + private rpId = new BehaviorSubject(null); private availableCipherIdsSubject = new BehaviorSubject([""]); /** * Observable that emits available cipher IDs once they're confirmed by the UI diff --git a/apps/desktop/src/modal/passkeys/create/fido2-create.component.html b/apps/desktop/src/modal/passkeys/create/fido2-create.component.html index e3423d6d7f8..8fefae29fd0 100644 --- a/apps/desktop/src/modal/passkeys/create/fido2-create.component.html +++ b/apps/desktop/src/modal/passkeys/create/fido2-create.component.html @@ -3,7 +3,7 @@ disableMargin class="tw-border-0 tw-border-b tw-border-solid tw-border-secondary-300" > - +
@@ -16,7 +16,7 @@ type="button" bitIconButton="bwi-close" slot="end" - class="tw-mb-4 tw-mr-2" + class="passkey-header-close tw-mb-4 tw-mr-2" (click)="closeModal()" > Close diff --git a/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts b/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts index 776ceae9d85..48047f3a365 100644 --- a/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts +++ b/apps/desktop/src/modal/passkeys/create/fido2-create.component.ts @@ -1,5 +1,5 @@ import { CommonModule } from "@angular/common"; -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit, OnDestroy } from "@angular/core"; import { RouterModule, Router } from "@angular/router"; import { BehaviorSubject, firstValueFrom, map, Observable } from "rxjs"; @@ -22,6 +22,7 @@ import { SectionHeaderComponent, BitIconButtonComponent, } from "@bitwarden/components"; +import { PasswordRepromptService } from "@bitwarden/vault"; import { DesktopFido2UserInterfaceService, @@ -47,7 +48,7 @@ import { DesktopSettingsService } from "../../../platform/services/desktop-setti ], templateUrl: "fido2-create.component.html", }) -export class Fido2CreateComponent implements OnInit { +export class Fido2CreateComponent implements OnInit, OnDestroy { session?: DesktopFido2UserInterfaceSession = null; private ciphersSubject = new BehaviorSubject([]); ciphers$: Observable = this.ciphersSubject.asObservable(); @@ -61,10 +62,12 @@ export class Fido2CreateComponent implements OnInit { private readonly dialogService: DialogService, private readonly domainSettingsService: DomainSettingsService, private readonly logService: LogService, + private readonly passwordRepromptService: PasswordRepromptService, private readonly router: Router, ) {} async ngOnInit() { + await this.accountService.setShowHeader(false); this.session = this.fido2UserInterfaceService.getCurrentSession(); const rpid = await this.session.getRpId(); const equivalentDomains = await firstValueFrom( @@ -92,8 +95,16 @@ export class Fido2CreateComponent implements OnInit { .catch((error) => this.logService.error(error)); } + async ngOnDestroy() { + await this.accountService.setShowHeader(true); + } + async addPasskeyToCipher(cipher: CipherView) { - this.session.notifyConfirmCreateCredential(true, cipher); + const userVerified = cipher.reprompt + ? await this.passwordRepromptService.showPasswordPrompt() + : true; + + this.session.notifyConfirmCreateCredential(userVerified, cipher); } async confirmPasskey() { diff --git a/apps/desktop/src/modal/passkeys/fido2-vault.component.html b/apps/desktop/src/modal/passkeys/fido2-vault.component.html index edc241c4d21..5191dcb1b6e 100644 --- a/apps/desktop/src/modal/passkeys/fido2-vault.component.html +++ b/apps/desktop/src/modal/passkeys/fido2-vault.component.html @@ -3,7 +3,7 @@ disableMargin class="tw-border-0 tw-border-b tw-border-solid tw-border-secondary-300" > - +
@@ -13,7 +13,7 @@ type="button" bitIconButton="bwi-close" slot="end" - class="tw-mb-4 tw-mr-2" + class="passkey-header-close tw-mb-4 tw-mr-2" (click)="closeModal()" > Close @@ -23,7 +23,7 @@ -