mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-21 16:18:28 +01:00
PM-2403 - Persist SSO flag between 2FA component and 2FA Options component and back so that the correct onSuccessful login logic can run which closes the tab extension and sidesteps Safari master password invalid issues due to null KDF config / iterations again. Tested on Chrome, Firefox + sidebar, Edge, Opera + sidebar, and Safari (#5535)
This commit is contained in:
parent
9f3365623b
commit
1247463e29
@ -1,6 +1,6 @@
|
|||||||
<header>
|
<header>
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<button type="button" routerLink="/2fa">{{ "close" | i18n }}</button>
|
<button type="button" (click)="close()">{{ "close" | i18n }}</button>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="center">
|
<h1 class="center">
|
||||||
<span class="title">{{ "twoStepOptions" | i18n }}</span>
|
<span class="title">{{ "twoStepOptions" | i18n }}</span>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
import { Router } from "@angular/router";
|
import { ActivatedRoute, Router } from "@angular/router";
|
||||||
|
|
||||||
import { TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent } from "@bitwarden/angular/auth/components/two-factor-options.component";
|
import { TwoFactorOptionsComponent as BaseTwoFactorOptionsComponent } from "@bitwarden/angular/auth/components/two-factor-options.component";
|
||||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||||
@ -15,14 +15,33 @@ export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {
|
|||||||
twoFactorService: TwoFactorService,
|
twoFactorService: TwoFactorService,
|
||||||
router: Router,
|
router: Router,
|
||||||
i18nService: I18nService,
|
i18nService: I18nService,
|
||||||
platformUtilsService: PlatformUtilsService
|
platformUtilsService: PlatformUtilsService,
|
||||||
|
private activatedRoute: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
super(twoFactorService, router, i18nService, platformUtilsService, window);
|
super(twoFactorService, router, i18nService, platformUtilsService, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.navigateTo2FA();
|
||||||
|
}
|
||||||
|
|
||||||
choose(p: any) {
|
choose(p: any) {
|
||||||
super.choose(p);
|
super.choose(p);
|
||||||
this.twoFactorService.setSelectedProvider(p.type);
|
this.twoFactorService.setSelectedProvider(p.type);
|
||||||
this.router.navigate(["2fa"]);
|
|
||||||
|
this.navigateTo2FA();
|
||||||
|
}
|
||||||
|
|
||||||
|
navigateTo2FA() {
|
||||||
|
const sso = this.activatedRoute.snapshot.queryParamMap.get("sso") === "true";
|
||||||
|
|
||||||
|
if (sso) {
|
||||||
|
// Persist SSO flag back to the 2FA comp if it exists
|
||||||
|
// in order for successful login logic to work properly for
|
||||||
|
// SSO + 2FA in browser extension
|
||||||
|
this.router.navigate(["2fa"], { queryParams: { sso: true } });
|
||||||
|
} else {
|
||||||
|
this.router.navigate(["2fa"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,15 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anotherMethod() {
|
anotherMethod() {
|
||||||
this.router.navigate(["2fa-options"]);
|
const sso = this.route.snapshot.queryParamMap.get("sso") === "true";
|
||||||
|
|
||||||
|
if (sso) {
|
||||||
|
// We must persist this so when the user returns to the 2FA comp, the
|
||||||
|
// proper onSuccessfulLogin logic is executed.
|
||||||
|
this.router.navigate(["2fa-options"], { queryParams: { sso: true } });
|
||||||
|
} else {
|
||||||
|
this.router.navigate(["2fa-options"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isLinux() {
|
async isLinux() {
|
||||||
|
Loading…
Reference in New Issue
Block a user