Add button to open webauthn new tab (#398)
This commit is contained in:
parent
1016bbfb9e
commit
ff387622e0
|
@ -114,13 +114,11 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
|
||||||
const providerData = this.authService.twoFactorProvidersData.get(this.selectedProviderType);
|
const providerData = this.authService.twoFactorProvidersData.get(this.selectedProviderType);
|
||||||
switch (this.selectedProviderType) {
|
switch (this.selectedProviderType) {
|
||||||
case TwoFactorProviderType.WebAuthn:
|
case TwoFactorProviderType.WebAuthn:
|
||||||
if (!this.webAuthnSupported || this.webAuthn == null) {
|
if (!this.webAuthnNewTab) {
|
||||||
break;
|
setTimeout(() => {
|
||||||
|
this.authWebAuthn();
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
this.webAuthn.init(providerData);
|
|
||||||
}, 500);
|
|
||||||
break;
|
break;
|
||||||
case TwoFactorProviderType.Duo:
|
case TwoFactorProviderType.Duo:
|
||||||
case TwoFactorProviderType.OrganizationDuo:
|
case TwoFactorProviderType.OrganizationDuo:
|
||||||
|
@ -221,6 +219,16 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
|
||||||
this.emailPromise = null;
|
this.emailPromise = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
authWebAuthn() {
|
||||||
|
const providerData = this.authService.twoFactorProvidersData.get(this.selectedProviderType);
|
||||||
|
|
||||||
|
if (!this.webAuthnSupported || this.webAuthn == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.webAuthn.init(providerData);
|
||||||
|
}
|
||||||
|
|
||||||
private cleanupWebAuthn() {
|
private cleanupWebAuthn() {
|
||||||
if (this.webAuthn != null) {
|
if (this.webAuthn != null) {
|
||||||
this.webAuthn.stop();
|
this.webAuthn.stop();
|
||||||
|
|
Loading…
Reference in New Issue