init u2f param

This commit is contained in:
Kyle Spearrin 2019-07-03 10:37:26 -04:00
parent cfec7c4815
commit 05859a1df3
1 changed files with 5 additions and 2 deletions

View File

@ -27,6 +27,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
token: string = '';
remember: boolean = false;
u2fReady: boolean = false;
initU2f: boolean = true;
providers = TwoFactorProviders;
providerType = TwoFactorProviderType;
selectedProviderType: TwoFactorProviderType = TwoFactorProviderType.Authenticator;
@ -57,7 +58,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
return;
}
if (this.win != null && this.u2fSupported) {
if (this.initU2f && this.win != null && this.u2fSupported) {
let customWebVaultUrl: string = null;
if (this.environmentService.baseUrl != null) {
customWebVaultUrl = this.environmentService.baseUrl;
@ -102,7 +103,9 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
}
if (providerData.Challenge != null) {
this.u2f.init(JSON.parse(providerData.Challenge));
setTimeout(() => {
this.u2f.init(JSON.parse(providerData.Challenge));
}, 500);
} else {
// TODO: Deprecated. Remove in future version.
const challenges = JSON.parse(providerData.Challenges);