Check for sdk token instead of token type DEV

This commit is contained in:
Johannes Zellner
2016-06-03 10:17:52 +02:00
parent 10163733db
commit e335aa5dee
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -457,7 +457,7 @@ var token = [
];
// tests if all requestedScopes are attached to the request
function hasRequestedScopes(req, requestedScopes) {
function validateRequestedScopes(req, requestedScopes) {
assert.strictEqual(typeof req, 'object');
assert(Array.isArray(requestedScopes));
@@ -494,7 +494,7 @@ function scope(requestedScope) {
return [
passport.authenticate(['bearer'], { session: false }),
function (req, res, next) {
var error = hasRequestedScopes(req, requestedScopes);
var error = validateRequestedScopes(req, requestedScopes);
if (error) return next(new HttpError(401, error.message));
next();
@@ -526,7 +526,7 @@ exports = module.exports = {
accountSetup: accountSetup,
authorization: authorization,
token: token,
hasRequestedScopes: hasRequestedScopes,
validateRequestedScopes: validateRequestedScopes,
scope: scope,
csrf: csrf
};