From 2033e4668391cea3e0bda7f65b5812fdeb09e5c1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 11 Jun 2018 13:33:00 -0400 Subject: [PATCH] load DuoWebSDK as a module --- jslib | 2 +- src/2fa/2fa.ts | 6 +++--- src/popup/main.ts | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/jslib b/jslib index cd3c2ddff1..4bd9a9fc11 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit cd3c2ddff1abd66c6318d981a389685dc82cfc0e +Subproject commit 4bd9a9fc1121cd2f9bbe3b414c6239040b4fe880 diff --git a/src/2fa/2fa.ts b/src/2fa/2fa.ts index b2f4e3f358..968261ae66 100644 --- a/src/2fa/2fa.ts +++ b/src/2fa/2fa.ts @@ -1,5 +1,4 @@ -// tslint:disable-next-line -require('../scripts/duo.js'); +import * as DuoWebSDK from 'jslib/misc/duo'; document.addEventListener('DOMContentLoaded', () => { const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 && @@ -19,7 +18,8 @@ document.addEventListener('DOMContentLoaded', () => { } if (msg.data.type === 'duo') { - (window as any).Duo.init({ + DuoWebSDK.init({ + iframe: undefined, host: msg.data.host, sig_request: msg.data.signature, submit_callback: (theForm: Document) => { diff --git a/src/popup/main.ts b/src/popup/main.ts index dceff71e4e..18a6af9db7 100644 --- a/src/popup/main.ts +++ b/src/popup/main.ts @@ -4,8 +4,6 @@ import 'web-animations-js'; // tslint:disable-next-line require('./scss/popup.scss'); -// tslint:disable-next-line -require('../scripts/duo.js'); import { AppModule } from './app.module';