added another place in token to find grants in tokens
This commit is contained in:
parent
fa3816390b
commit
dae941323b
|
@ -280,12 +280,13 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
|
|||
res.send({ error: { message: "You must be logged in", code: "E_NO_AUTHN" } });
|
||||
return;
|
||||
}
|
||||
if ('string' !== typeof req.oauth3.token.scp) {
|
||||
res.send({ error: { message: "Token must contain a grants string in 'scp'", code: "E_NO_GRANTS" } });
|
||||
var scope = req.oauth3.token.scope || req.oauth3.token.scp || req.oauth3.token.grants;
|
||||
if ('string' !== typeof scope) {
|
||||
res.send({ error: { message: "Token must contain a grants string in 'scope'", code: "E_NO_GRANTS" } });
|
||||
return;
|
||||
}
|
||||
|
||||
tokenScopes = req.oauth3.token.scp.split(/[,\s]+/mg);
|
||||
tokenScopes = scope.split(/[,\s]+/mg);
|
||||
if (-1 !== tokenScopes.indexOf('*')) {
|
||||
// has full account access
|
||||
next();
|
||||
|
|
Loading…
Reference in New Issue