enable showing all grants
This commit is contained in:
parent
23d599835b
commit
b7aa754c48
|
@ -192,8 +192,9 @@ OAUTH3.urls.grants = function (directive, opts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = OAUTH3.url.resolve(directive.api, grantsDir.url)
|
var url = OAUTH3.url.resolve(directive.api, grantsDir.url)
|
||||||
.replace(/(:azp|:client_id)/g, OAUTH3.uri.normalize(opts.client_id || opts.client_uri))
|
|
||||||
.replace(/(:sub|:account_id)/g, opts.session.token.sub || 'ISSUER:GRANT:TOKEN_SUB:UNDEFINED')
|
.replace(/(:sub|:account_id)/g, opts.session.token.sub || 'ISSUER:GRANT:TOKEN_SUB:UNDEFINED')
|
||||||
|
.replace(/(:azp|:client_id)/g, !opts.all && OAUTH3.uri.normalize(opts.client_id || opts.client_uri) || '')
|
||||||
|
.replace(/\/\/$/, '/') // if there's a double slash due to the sub not existing
|
||||||
;
|
;
|
||||||
var data = {
|
var data = {
|
||||||
client_id: opts.client_id
|
client_id: opts.client_id
|
||||||
|
@ -432,7 +433,7 @@ OAUTH3.authz.grants = function (providerUri, opts) {
|
||||||
}
|
}
|
||||||
// the responses for GET and POST requests are now the same, so we should alway be able to
|
// the responses for GET and POST requests are now the same, so we should alway be able to
|
||||||
// use the response and save it the same way.
|
// use the response and save it the same way.
|
||||||
if ('GET' !== opts.method && 'POST' !== opts.method) {
|
if (opts.all || ('GET' !== opts.method && 'POST' !== opts.method)) {
|
||||||
return grants;
|
return grants;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue