From 03cd3f0b6f4e85074b39faa0bb7edb00d7eb3ad4 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Fri, 3 Jun 2016 12:53:11 +0200 Subject: [PATCH] Remove attached tokenType on req.user --- src/auth.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/auth.js b/src/auth.js index 422da3709..503625804 100644 --- a/src/auth.js +++ b/src/auth.js @@ -101,23 +101,15 @@ function initialize(callback) { // scopes here can define what capabilities that token carries // passport put the 'info' object into req.authInfo, where we can further validate the scopes var info = { scope: token.scope }; - var tokenType; if (token.identifier.indexOf(tokendb.PREFIX_USER) === 0) { - tokenType = tokendb.TYPE_USER; token.identifier = token.identifier.slice(tokendb.PREFIX_USER.length); - } else { - // legacy tokens assuming a user access token - tokenType = tokendb.TYPE_USER; } userdb.get(token.identifier, function (error, user) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(null, false); if (error) return callback(error); - // amend the tokenType of the token owner - user.tokenType = tokenType; - // amend the admin flag groups.isMember(groups.ADMIN_GROUP_ID, user.id, function (error, isAdmin) { if (error) return callback(error);