1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-26 12:25:20 +01:00

Add button to open webauthn new tab (#398)

This commit is contained in:
Oscar Hinton 2021-06-07 18:38:15 +02:00 committed by GitHub
parent 1016bbfb9e
commit ff387622e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,13 +114,11 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
const providerData = this.authService.twoFactorProvidersData.get(this.selectedProviderType);
switch (this.selectedProviderType) {
case TwoFactorProviderType.WebAuthn:
if (!this.webAuthnSupported || this.webAuthn == null) {
break;
}
if (!this.webAuthnNewTab) {
setTimeout(() => {
this.webAuthn.init(providerData);
this.authWebAuthn();
}, 500);
}
break;
case TwoFactorProviderType.Duo:
case TwoFactorProviderType.OrganizationDuo:
@ -221,6 +219,16 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
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() {
if (this.webAuthn != null) {
this.webAuthn.stop();