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