From 05859a1df34dfd07392e7c88cc64a724044e74a5 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 3 Jul 2019 10:37:26 -0400 Subject: [PATCH] init u2f param --- src/angular/components/two-factor.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/angular/components/two-factor.component.ts b/src/angular/components/two-factor.component.ts index dd460a16c5..66eb59f9eb 100644 --- a/src/angular/components/two-factor.component.ts +++ b/src/angular/components/two-factor.component.ts @@ -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);