1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

Fix tde offboarding

This commit is contained in:
Bernd Schoolmann
2025-01-20 12:07:49 +01:00
parent 374ea6af7c
commit 6bfda240d4
2 changed files with 25 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv
import { AnonymousHubService } from "@bitwarden/common/auth/abstractions/anonymous-hub.service";
import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service";
import { DeviceTrustServiceAbstraction } from "@bitwarden/common/auth/abstractions/device-trust.service.abstraction";
import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/auth/abstractions/master-password.service.abstraction";
import { AuthRequestType } from "@bitwarden/common/auth/enums/auth-request-type";
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status";
import { AdminAuthRequestStorable } from "@bitwarden/common/auth/models/domain/admin-auth-req-storable";
@@ -92,6 +93,7 @@ export class LoginViaAuthRequestComponentV1
private authRequestService: AuthRequestServiceAbstraction,
private loginStrategyService: LoginStrategyServiceAbstraction,
protected toastService: ToastService,
private masterPasswordService: InternalMasterPasswordServiceAbstraction,
) {
super(environmentService, i18nService, platformUtilsService, toastService);
@@ -513,6 +515,17 @@ export class LoginViaAuthRequestComponentV1
await this.loginEmailService.saveEmailSettings();
}
if (
(await firstValueFrom(
this.masterPasswordService.forceSetPasswordReason$(
(await firstValueFrom(this.accountService.activeAccount$)).id,
),
)) !== ForceSetPasswordReason.None
) {
await this.router.navigate([this.forcePasswordResetRoute]);
return;
}
if (this.onSuccessfulLogin != null) {
// FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
// eslint-disable-next-line @typescript-eslint/no-floating-promises