diff --git a/angular/src/components/two-factor.component.ts b/angular/src/components/two-factor.component.ts index e324c586d6..9369482d05 100644 --- a/angular/src/components/two-factor.component.ts +++ b/angular/src/components/two-factor.component.ts @@ -44,6 +44,10 @@ export class TwoFactorComponent implements OnInit, OnDestroy { onSuccessfulLogin: () => Promise; onSuccessfulLoginNavigate: () => Promise; + get webAuthnAllow(): string { + return `publickey-credentials-get ${this.environmentService.getWebVaultUrl()}`; + } + protected loginRoute = 'login'; protected successRoute = 'vault'; diff --git a/common/src/misc/webauthn_iframe.ts b/common/src/misc/webauthn_iframe.ts index 50870c5794..24aac0f8c4 100644 --- a/common/src/misc/webauthn_iframe.ts +++ b/common/src/misc/webauthn_iframe.ts @@ -1,6 +1,8 @@ import { I18nService } from '../abstractions/i18n.service'; import { PlatformUtilsService } from '../abstractions/platformUtils.service'; + import { IFrameComponent } from './iframe_component'; +import { Utils } from './utils'; export class WebAuthnIFrame extends IFrameComponent { constructor(win: Window, webVaultUrl: string, private webAuthnNewTab: boolean, @@ -20,7 +22,9 @@ export class WebAuthnIFrame extends IFrameComponent { this.platformUtilsService.launchUri(`${this.webVaultUrl}/webauthn-fallback-connector.html?${params}`); } else { super.initComponent(params); - this.iframe.allow = 'publickey-credentials-get ' + new URL(this.webVaultUrl).origin; + if (Utils.isNullOrWhitespace(this.iframe.allow)) { + this.iframe.allow = 'publickey-credentials-get ' + new URL(this.webVaultUrl).origin; + } } } }