fixed bug clearing old session fields in session refresh

This commit is contained in:
tigerbot 2017-10-12 12:10:42 -06:00
parent 704337e30b
commit 26e9a1c08b
1 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@
, uri: { , uri: {
normalize: function (uri) { normalize: function (uri) {
if ('string' !== typeof uri) { if ('string' !== typeof uri) {
console.error((new Error('stack')).stack); throw new Error('must provide a string to OAUTH3.uri.normalize');
} }
// tested with // tested with
// example.com // example.com
@ -94,7 +94,7 @@
, url: { , url: {
normalize: function (url) { normalize: function (url) {
if ('string' !== typeof url) { if ('string' !== typeof url) {
console.error((new Error('stack')).stack); throw new Error('must provide a string to OAUTH3.url.normalize');
} }
// tested with // tested with
// example.com // example.com
@ -473,7 +473,7 @@
var providerUri = oldSession.provider_uri; var providerUri = oldSession.provider_uri;
var clientUri = oldSession.client_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; oldSession[key] = undefined;
}); });
Object.keys(newSession).forEach(function (key) { Object.keys(newSession).forEach(function (key) {
@ -1198,7 +1198,7 @@
} }
} }
} }
, _initClient: function (location/*, opts*/) { , _initClient: function () {
var me = this; var me = this;
return OAUTH3.discover(me._clientUri, { client_id: me._clientUri }).then(function (clientDirectives) { return OAUTH3.discover(me._clientUri, { client_id: me._clientUri }).then(function (clientDirectives) {
me._clientDirectives = clientDirectives; me._clientDirectives = clientDirectives;