diff --git a/src/routes/oauth2.js b/src/routes/oauth2.js index 9755d3898..2db6e7572 100644 --- a/src/routes/oauth2.js +++ b/src/routes/oauth2.js @@ -78,7 +78,7 @@ gServer.grant(oauth2orize.grant.token({ scopeSeparator: ',' }, function (client, var token = tokendb.generateToken(); var expires = Date.now() + 24 * 60 * 60 * 1000; // 1 day - tokendb.add(token, tokendb.PREFIX_USER + user.id, client.id, expires, client.scope, function (error) { + tokendb.add(token, user.id, client.id, expires, client.scope, function (error) { if (error) return callback(error); debug('grant token: new access token for client %s token %s', client.id, token); @@ -108,7 +108,7 @@ gServer.exchange(oauth2orize.exchange.code(function (client, code, redirectURI, var token = tokendb.generateToken(); var expires = Date.now() + 24 * 60 * 60 * 1000; // 1 day - tokendb.add(token, tokendb.PREFIX_USER + authCode.userId, authCode.clientId, expires, client.scope, function (error) { + tokendb.add(token, authCode.userId, authCode.clientId, expires, client.scope, function (error) { if (error) return callback(error); debug('exchange: new access token for client %s token %s', client.id, token); diff --git a/src/simpleauth.js b/src/simpleauth.js index d9016e43e..12db4db41 100644 --- a/src/simpleauth.js +++ b/src/simpleauth.js @@ -54,7 +54,7 @@ function loginLogic(clientId, username, password, callback) { var accessToken = tokendb.generateToken(); var expires = Date.now() + 24 * 60 * 60 * 1000; // 1 day - tokendb.add(accessToken, tokendb.PREFIX_USER + userObject.id, clientId, expires, clientObject.scope, function (error) { + tokendb.add(accessToken, userObject.id, clientId, expires, clientObject.scope, function (error) { if (error) return callback(error); debug('login: new access token for client %s and user %s: %s', clientId, username, accessToken);