Remove scope from users.get

This commit is contained in:
Girish Ramakrishnan
2018-06-17 15:25:41 -07:00
parent db8b6838bb
commit 156ffb40c9
7 changed files with 33 additions and 54 deletions

View File

@@ -69,13 +69,11 @@ function validateScope(scope) {
}
// tests if all requiredScopes are attached to the request
function hasScopes(authInfo, requiredScopes) {
assert.strictEqual(typeof authInfo, 'object');
function hasScopes(authorizedScope, requiredScopes) {
assert.strictEqual(typeof authorizedScope, 'string');
assert(Array.isArray(requiredScopes), 'Expecting array');
if (!authInfo || !authInfo.scope) return new Error('No scope found');
var scopes = authInfo.scope.split(',');
var scopes = authorizedScope.split(',');
if (scopes.indexOf(exports.SCOPE_ANY) !== -1) return null;