merge bugfixes
This commit is contained in:
commit
32609e20fa
|
@ -484,7 +484,8 @@
|
||||||
// info about the newly-discovered token
|
// info about the newly-discovered token
|
||||||
oldSession.token = OAUTH3.jwt.decode(oldSession.access_token).payload;
|
oldSession.token = OAUTH3.jwt.decode(oldSession.access_token).payload;
|
||||||
|
|
||||||
oldSession.token.sub = oldSession.token.sub || (oldSession.token.acx||{}).id
|
oldSession.token.sub = oldSession.token.sub
|
||||||
|
|| (oldSession.token.acx||{}).id
|
||||||
|| ((oldSession.token.axs||[])[0]||{}).appScopedId
|
|| ((oldSession.token.axs||[])[0]||{}).appScopedId
|
||||||
|| ((oldSession.token.axs||[])[0]||{}).id
|
|| ((oldSession.token.axs||[])[0]||{}).id
|
||||||
;
|
;
|
||||||
|
@ -493,7 +494,8 @@
|
||||||
|
|
||||||
if (oldSession.refresh_token) {
|
if (oldSession.refresh_token) {
|
||||||
oldSession.refresh = OAUTH3.jwt.decode(oldSession.refresh_token).payload;
|
oldSession.refresh = OAUTH3.jwt.decode(oldSession.refresh_token).payload;
|
||||||
oldSession.refresh.sub = oldSession.refresh.sub || (oldSession.refresh.acx||{}).id
|
oldSession.refresh.sub = oldSession.refresh.sub
|
||||||
|
|| (oldSession.refresh.acx||{}).id
|
||||||
|| ((oldSession.refresh.axs||[])[0]||{}).appScopedId
|
|| ((oldSession.refresh.axs||[])[0]||{}).appScopedId
|
||||||
|| ((oldSession.refresh.axs||[])[0]||{}).id
|
|| ((oldSession.refresh.axs||[])[0]||{}).id
|
||||||
;
|
;
|
||||||
|
|
|
@ -208,7 +208,7 @@ OAUTH3.urls.grants = function (directive, opts) {
|
||||||
|
|
||||||
var url = OAUTH3.url.resolve(directive.api, directive.grants.url)
|
var url = OAUTH3.url.resolve(directive.api, directive.grants.url)
|
||||||
.replace(/(:azp|:client_id)/g, OAUTH3.uri.normalize(opts.client_id || opts.client_uri))
|
.replace(/(:azp|:client_id)/g, OAUTH3.uri.normalize(opts.client_id || opts.client_uri))
|
||||||
.replace(/(:sub|:account_id)/g, opts.session.token.sub)
|
.replace(/(:sub|:account_id)/g, opts.session.token.sub || 'ISSUER:GRANT:TOKEN_SUB:UNDEFINED')
|
||||||
;
|
;
|
||||||
var data = {
|
var data = {
|
||||||
client_id: opts.client_id
|
client_id: opts.client_id
|
||||||
|
@ -425,6 +425,17 @@ OAUTH3.authz.redirectWithToken = function (providerUri, session, clientParams, s
|
||||||
, debug: clientParams.debug
|
, debug: clientParams.debug
|
||||||
}).then(function (results) {
|
}).then(function (results) {
|
||||||
|
|
||||||
|
// TODO limit refresh token to an expirable token
|
||||||
|
// TODO inform client not to persist token
|
||||||
|
/*
|
||||||
|
if (clientParams.dnsTxt) {
|
||||||
|
Object.keys(results).forEach(function (key) {
|
||||||
|
if (/refresh/.test(key)) {
|
||||||
|
results[key] = undefined;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
||||||
OAUTH3.url.redirect(clientParams, scopes, results);
|
OAUTH3.url.redirect(clientParams, scopes, results);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue