1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-19 01:51:27 +01:00

PM-8113 - TwoFactorAuth - update to latest authN session timeout logic

This commit is contained in:
Jared Snider 2025-01-23 18:19:43 -05:00
parent 37ac40098c
commit 1b72325aa6
No known key found for this signature in database
GPG Key ID: A149DDD612516286

View File

@ -113,7 +113,7 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
await this.submit(); await this.submit();
}; };
private twoFactorSessionTimeoutRoute = "2fa-timeout"; private authenticationSessionTimeoutRoute = "authentication-timeout";
constructor( constructor(
private loginStrategyService: LoginStrategyServiceAbstraction, private loginStrategyService: LoginStrategyServiceAbstraction,
@ -144,7 +144,7 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
this.orgSsoIdentifier = this.orgSsoIdentifier =
this.activatedRoute.snapshot.queryParamMap.get("identifier") ?? undefined; this.activatedRoute.snapshot.queryParamMap.get("identifier") ?? undefined;
this.listenFor2faSessionTimeout(); this.listenForAuthnSessionTimeout();
await this.setSelected2faProviderType(); await this.setSelected2faProviderType();
await this.set2faProviderData(); await this.set2faProviderData();
@ -192,8 +192,8 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
this.providerData = providerData; this.providerData = providerData;
} }
private listenFor2faSessionTimeout() { private listenForAuthnSessionTimeout() {
this.loginStrategyService.twoFactorTimeout$ this.loginStrategyService.authenticationSessionTimeout$
.pipe(takeUntilDestroyed(this.destroyRef)) .pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(async (expired) => { .subscribe(async (expired) => {
if (!expired) { if (!expired) {
@ -201,10 +201,10 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
} }
try { try {
await this.router.navigate([this.twoFactorSessionTimeoutRoute]); await this.router.navigate([this.authenticationSessionTimeoutRoute]);
} catch (err) { } catch (err) {
this.logService.error( this.logService.error(
`Failed to navigate to ${this.twoFactorSessionTimeoutRoute} route`, `Failed to navigate to ${this.authenticationSessionTimeoutRoute} route`,
err, err,
); );
} }