load DuoWebSDK as a module

This commit is contained in:
Kyle Spearrin 2018-06-11 13:32:53 -04:00
parent d875b9aeb0
commit 4bd9a9fc11
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -4,6 +4,8 @@
"moduleResolution": "node",
"target": "ES6",
"module": "commonjs",
"lib": ["es5", "es6", "dom"],
"allowJs": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,