Provide information to set webauthn allow in html template (#455)
This commit is contained in:
parent
c5f236c2e4
commit
0180d0cce5
|
@ -44,6 +44,10 @@ export class TwoFactorComponent implements OnInit, OnDestroy {
|
||||||
onSuccessfulLogin: () => Promise<any>;
|
onSuccessfulLogin: () => Promise<any>;
|
||||||
onSuccessfulLoginNavigate: () => Promise<any>;
|
onSuccessfulLoginNavigate: () => Promise<any>;
|
||||||
|
|
||||||
|
get webAuthnAllow(): string {
|
||||||
|
return `publickey-credentials-get ${this.environmentService.getWebVaultUrl()}`;
|
||||||
|
}
|
||||||
|
|
||||||
protected loginRoute = 'login';
|
protected loginRoute = 'login';
|
||||||
protected successRoute = 'vault';
|
protected successRoute = 'vault';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import { I18nService } from '../abstractions/i18n.service';
|
import { I18nService } from '../abstractions/i18n.service';
|
||||||
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
import { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||||
|
|
||||||
import { IFrameComponent } from './iframe_component';
|
import { IFrameComponent } from './iframe_component';
|
||||||
|
import { Utils } from './utils';
|
||||||
|
|
||||||
export class WebAuthnIFrame extends IFrameComponent {
|
export class WebAuthnIFrame extends IFrameComponent {
|
||||||
constructor(win: Window, webVaultUrl: string, private webAuthnNewTab: boolean,
|
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}`);
|
this.platformUtilsService.launchUri(`${this.webVaultUrl}/webauthn-fallback-connector.html?${params}`);
|
||||||
} else {
|
} else {
|
||||||
super.initComponent(params);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue