From f2e6ea5890de6240f3c3bdf290b0b9dd9ae1d8f4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 20 Mar 2017 17:55:00 -0600 Subject: [PATCH] test for window --- oauth3.core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oauth3.core.js b/oauth3.core.js index e609400..2295f9e 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -148,7 +148,7 @@ // TODO put in different file for browser vs node try { return Array.prototype.slice.call( - window.crypto.getRandomValues(new Uint8Array(16)) + OAUTH3._browser.window.crypto.getRandomValues(new Uint8Array(16)) ).map(function (ch) { return (ch).toString(16); }).join(''); } catch(e) { return OAUTH3.utils._insecureRandomState(); @@ -723,7 +723,7 @@ // Let the Code Waste begin!! // , _browser: { - window: window + window: 'undefined' !== typeof window ? window : null // TODO we don't need to include this if we're using jQuery or angular , discover: function(providerUri, opts) { opts = opts || {};