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" } });
|
res.send({ error: { message: "You must be logged in", code: "E_NO_AUTHN" } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ('string' !== typeof req.oauth3.token.scp) {
|
var scope = req.oauth3.token.scope || req.oauth3.token.scp || req.oauth3.token.grants;
|
||||||
res.send({ error: { message: "Token must contain a grants string in 'scp'", code: "E_NO_GRANTS" } });
|
if ('string' !== typeof scope) {
|
||||||
|
res.send({ error: { message: "Token must contain a grants string in 'scope'", code: "E_NO_GRANTS" } });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenScopes = req.oauth3.token.scp.split(/[,\s]+/mg);
|
tokenScopes = scope.split(/[,\s]+/mg);
|
||||||
if (-1 !== tokenScopes.indexOf('*')) {
|
if (-1 !== tokenScopes.indexOf('*')) {
|
||||||
// has full account access
|
// has full account access
|
||||||
next();
|
next();
|
||||||
|
|
Loading…
Reference in New Issue