From 26e9a1c08bbe4ed5074f07c59cb187ae1242469c Mon Sep 17 00:00:00 2001 From: tigerbot Date: Thu, 12 Oct 2017 12:10:42 -0600 Subject: [PATCH] fixed bug clearing old session fields in session refresh --- oauth3.core.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oauth3.core.js b/oauth3.core.js index 2a77c9f..825a882 100644 --- a/oauth3.core.js +++ b/oauth3.core.js @@ -78,7 +78,7 @@ , uri: { normalize: function (uri) { if ('string' !== typeof uri) { - console.error((new Error('stack')).stack); + throw new Error('must provide a string to OAUTH3.uri.normalize'); } // tested with // example.com @@ -94,7 +94,7 @@ , url: { normalize: function (url) { if ('string' !== typeof url) { - console.error((new Error('stack')).stack); + throw new Error('must provide a string to OAUTH3.url.normalize'); } // tested with // example.com @@ -473,7 +473,7 @@ var providerUri = oldSession.provider_uri; var clientUri = oldSession.client_uri; - Object.keys(['access_token', 'token', 'client_uri', 'refresh', 'refresh_token', 'expires_in', 'provider_uri', 'scope', 'token_type']).forEach(function (key) { + ['access_token', 'token', 'client_uri', 'refresh', 'refresh_token', 'expires_in', 'provider_uri', 'scope', 'token_type'].forEach(function (key) { oldSession[key] = undefined; }); Object.keys(newSession).forEach(function (key) { @@ -1198,7 +1198,7 @@ } } } - , _initClient: function (location/*, opts*/) { + , _initClient: function () { var me = this; return OAUTH3.discover(me._clientUri, { client_id: me._clientUri }).then(function (clientDirectives) { me._clientDirectives = clientDirectives;