Merge branch 'storage-and-versioning' into 'master'
add versioning and storage See merge request !1
This commit is contained in:
commit
2dda2c8729
19
js/issuer.js
19
js/issuer.js
|
@ -1,6 +1,11 @@
|
||||||
$(function () {
|
$(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
if ('1' !== window.localStorage.getItem('version')) {
|
||||||
|
window.localStorage.clear();
|
||||||
|
window.localStorage.setItem('version', '1');
|
||||||
|
}
|
||||||
|
|
||||||
var OAUTH3 = window.OAUTH3;
|
var OAUTH3 = window.OAUTH3;
|
||||||
var CONFIG = {
|
var CONFIG = {
|
||||||
host: OAUTH3.utils.clientUri(window.location)
|
host: OAUTH3.utils.clientUri(window.location)
|
||||||
|
@ -14,6 +19,20 @@ $(function () {
|
||||||
};
|
};
|
||||||
$('.js-scopes-container').html('');
|
$('.js-scopes-container').html('');
|
||||||
|
|
||||||
|
/*
|
||||||
|
OAUTH3._hooks.sessions.all = function (providerUri) {
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
OAUTH3._hooks = { sessions: {} };
|
||||||
|
OAUTH3._hooks.sessions.get = function (providerUri, id) {
|
||||||
|
return JSON.parse(window.localStorage.getItem('session-' + providerUri + (id || '')) || 'null');
|
||||||
|
};
|
||||||
|
OAUTH3._hooks.sessions.set = function (providerUri, newSession, id) {
|
||||||
|
window.localStorage.setItem('session-' + providerUri, JSON.stringify(newSession));
|
||||||
|
window.localStorage.setItem('session-' + providerUri + (id || newSession.id || newSession.token.id || ''), JSON.stringify(newSession));
|
||||||
|
return newSession;
|
||||||
|
};
|
||||||
|
|
||||||
// TODO let query.parse do location.hash || location.search || location
|
// TODO let query.parse do location.hash || location.search || location
|
||||||
var clientParams = OAUTH3.query.parse(window.location.hash || window.location.search);
|
var clientParams = OAUTH3.query.parse(window.location.hash || window.location.search);
|
||||||
if (/authorization_dialog/.test(window.location.href)) {
|
if (/authorization_dialog/.test(window.location.href)) {
|
||||||
|
|
Loading…
Reference in New Issue