mirror of
https://github.com/bitwarden/browser
synced 2026-02-24 16:43:27 +00:00
Added support for handling a locked vault
This commit is contained in:
@@ -252,10 +252,19 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
|
||||
}
|
||||
}
|
||||
|
||||
private async showUi(route: string, position?: { x: number; y: number }): Promise<void> {
|
||||
private async showUi(
|
||||
route: string,
|
||||
position?: { x: number; y: number },
|
||||
disableRedirect?: boolean,
|
||||
): Promise<void> {
|
||||
// Load the UI:
|
||||
await this.desktopSettingsService.setModalMode(true, position);
|
||||
await this.router.navigate([route]);
|
||||
await this.router.navigate([
|
||||
route,
|
||||
{
|
||||
"disable-redirect": disableRedirect || null,
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,7 +318,17 @@ export class DesktopFido2UserInterfaceSession implements Fido2UserInterfaceSessi
|
||||
|
||||
const status = await firstValueFrom(this.authService.activeAccountStatus$);
|
||||
if (status !== AuthenticationStatus.Unlocked) {
|
||||
throw new Error("Vault is not unlocked");
|
||||
await this.showUi("/lock", this.windowObject.windowXy, true);
|
||||
const status2 = await lastValueFrom(
|
||||
this.authService.activeAccountStatus$.pipe(
|
||||
filter((s) => s === AuthenticationStatus.Unlocked),
|
||||
take(1),
|
||||
timeout(30000),
|
||||
),
|
||||
);
|
||||
if (status2 !== AuthenticationStatus.Unlocked) {
|
||||
throw new Error("Vault is not unlocked");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user