mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +01:00
onSuccessfulLoginNavigate for 2fa page
This commit is contained in:
parent
b3bd13fe2b
commit
a949f499ac
@ -38,7 +38,8 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
|
|||||||
twoFactorEmail: string = null;
|
twoFactorEmail: string = null;
|
||||||
formPromise: Promise<any>;
|
formPromise: Promise<any>;
|
||||||
emailPromise: Promise<any>;
|
emailPromise: Promise<any>;
|
||||||
onSuccessfullLogin: () => Promise<any>;
|
onSuccessfulLogin: () => Promise<any>;
|
||||||
|
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||||
|
|
||||||
protected loginRoute = 'login';
|
protected loginRoute = 'login';
|
||||||
protected successRoute = 'vault';
|
protected successRoute = 'vault';
|
||||||
@ -167,11 +168,15 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
|
|||||||
try {
|
try {
|
||||||
this.formPromise = this.authService.logInTwoFactor(this.selectedProviderType, this.token, this.remember);
|
this.formPromise = this.authService.logInTwoFactor(this.selectedProviderType, this.token, this.remember);
|
||||||
await this.formPromise;
|
await this.formPromise;
|
||||||
if (this.onSuccessfullLogin != null) {
|
if (this.onSuccessfulLogin != null) {
|
||||||
this.onSuccessfullLogin();
|
this.onSuccessfulLogin();
|
||||||
}
|
}
|
||||||
this.analytics.eventTrack.next({ action: 'Logged In From Two-step' });
|
this.analytics.eventTrack.next({ action: 'Logged In From Two-step' });
|
||||||
|
if (this.onSuccessfulLoginNavigate != null) {
|
||||||
|
this.onSuccessfulLoginNavigate();
|
||||||
|
} else {
|
||||||
this.router.navigate([this.successRoute]);
|
this.router.navigate([this.successRoute]);
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (this.selectedProviderType === TwoFactorProviderType.U2f && this.u2f != null) {
|
if (this.selectedProviderType === TwoFactorProviderType.U2f && this.u2f != null) {
|
||||||
this.u2f.start();
|
this.u2f.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user