no session should be null, not '{}'

This commit is contained in:
AJ ONeal 2017-03-02 00:49:22 -07:00
parent a2a6a9bcb1
commit f179cfe3c9
1 changed files with 2 additions and 2 deletions

View File

@ -538,7 +538,7 @@
}
, _get: function (providerUri) {
console.warn('[Warn] Please implement OAUTH3.hooks.session._get = function (providerUri) { return PromiseA<savedSession>; }');
return JSON.parse(window.localStorage.getItem('session-' + providerUri) || '{}');
return JSON.parse(window.localStorage.getItem('session-' + providerUri) || 'null');
}
, _set: function (providerUri, newSession) {
console.warn('[Warn] Please implement OAUTH3.hooks.session._set = function (providerUri, newSession) { return PromiseA<newSession>; }');
@ -1059,7 +1059,7 @@
});
}
, session: function () {
return JSON.parse(JSON.stringify(OAUTH3.hooks.session._getCached(this._providerUri) || {}));
return JSON.parse(JSON.stringify(OAUTH3.hooks.session._getCached(this._providerUri) || null));
}
, request: function (preq, opts) {
opts = opts || {};