mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-05 09:10:53 +01:00
ns updates and overloads
This commit is contained in:
parent
9fa99f3a6e
commit
c35576deb8
@ -27,6 +27,7 @@ export class LoginComponent implements OnInit {
|
|||||||
formPromise: Promise<AuthResult>;
|
formPromise: Promise<AuthResult>;
|
||||||
onSuccessfulLogin: () => Promise<any>;
|
onSuccessfulLogin: () => Promise<any>;
|
||||||
onSuccessfulLoginNavigate: () => Promise<any>;
|
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||||
|
onSuccessfulLoginTwoFactorNavigate: () => Promise<any>;
|
||||||
|
|
||||||
protected twoFactorRoute = '2fa';
|
protected twoFactorRoute = '2fa';
|
||||||
protected successRoute = 'vault';
|
protected successRoute = 'vault';
|
||||||
@ -79,7 +80,11 @@ export class LoginComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
if (response.twoFactor) {
|
if (response.twoFactor) {
|
||||||
this.platformUtilsService.eventTrack('Logged In To Two-step');
|
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 {
|
} else {
|
||||||
if (this.onSuccessfulLogin != null) {
|
if (this.onSuccessfulLogin != null) {
|
||||||
this.onSuccessfulLogin();
|
this.onSuccessfulLogin();
|
||||||
|
@ -22,7 +22,7 @@ export class Utils {
|
|||||||
Utils.isBrowser = typeof window !== 'undefined';
|
Utils.isBrowser = typeof window !== 'undefined';
|
||||||
Utils.isNativeScript = !Utils.isNode && !Utils.isBrowser;
|
Utils.isNativeScript = !Utils.isNode && !Utils.isBrowser;
|
||||||
Utils.isMobileBrowser = Utils.isBrowser && this.isMobile(window);
|
Utils.isMobileBrowser = Utils.isBrowser && this.isMobile(window);
|
||||||
Utils.global = Utils.isNativeScript ? new Object() : (Utils.isNode && !Utils.isBrowser ? global : window);
|
Utils.global = Utils.isNativeScript ? global : (Utils.isNode && !Utils.isBrowser ? global : window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static fromB64ToArray(str: string): Uint8Array {
|
static fromB64ToArray(str: string): Uint8Array {
|
||||||
|
Loading…
Reference in New Issue
Block a user