1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 01:03:35 +00:00

ns updates and overloads

This commit is contained in:
Kyle Spearrin
2018-10-13 00:11:06 -04:00
parent 9fa99f3a6e
commit c35576deb8
2 changed files with 7 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ export class LoginComponent implements OnInit {
formPromise: Promise<AuthResult>;
onSuccessfulLogin: () => Promise<any>;
onSuccessfulLoginNavigate: () => Promise<any>;
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
protected twoFactorRoute = '2fa';
protected successRoute = 'vault';
@@ -79,7 +80,11 @@ export class LoginComponent implements OnInit {
}
if (response.twoFactor) {
this.platformUtilsService.eventTrack('Logged In To Two-step');
this.router.navigate([this.twoFactorRoute]);
if (this.onSuccessfulLoginTwoFactorNavigate != null) {
this.onSuccessfulLoginTwoFactorNavigate();
} else {
this.router.navigate([this.twoFactorRoute]);
}
} else {
if (this.onSuccessfulLogin != null) {
this.onSuccessfulLogin();