diff --git a/src/angular/components/two-factor.component.ts b/src/angular/components/two-factor.component.ts index 9c2e4ca354..3ebaa32126 100644 --- a/src/angular/components/two-factor.component.ts +++ b/src/angular/components/two-factor.component.ts @@ -22,6 +22,7 @@ import { SyncService } from '../../abstractions/sync.service'; import { TwoFactorProviders } from '../../services/auth.service'; +import * as DuoWebSDK from '../../misc/duo'; import { U2f } from '../../misc/u2f'; export class TwoFactorComponent implements OnInit, OnDestroy { @@ -120,7 +121,8 @@ export class TwoFactorComponent implements OnInit, OnDestroy { } setTimeout(() => { - (this.win as any).Duo.init({ + DuoWebSDK.init({ + iframe: undefined, host: params.Host, sig_request: params.Signature, submit_callback: async (f: HTMLFormElement) => { @@ -131,7 +133,7 @@ export class TwoFactorComponent implements OnInit, OnDestroy { } }, }); - }); + }, 0); break; case TwoFactorProviderType.Email: this.twoFactorEmail = params.Email; diff --git a/tsconfig.json b/tsconfig.json index a745228386..490d58e983 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,8 @@ "moduleResolution": "node", "target": "ES6", "module": "commonjs", + "lib": ["es5", "es6", "dom"], + "allowJs": true, "sourceMap": true, "declaration": true, "allowSyntheticDefaultImports": true,