@@ -1,11 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = {
|
||||
passwordAuth: passwordAuth,
|
||||
tokenAuth: tokenAuth,
|
||||
passwordAuth,
|
||||
tokenAuth,
|
||||
|
||||
authorize: authorize,
|
||||
websocketAuth: websocketAuth
|
||||
authorize,
|
||||
websocketAuth
|
||||
};
|
||||
|
||||
var accesscontrol = require('../accesscontrol.js'),
|
||||
@@ -99,6 +99,7 @@ function tokenAuth(req, res, next) {
|
||||
if (error && error.reason === BoxError.INVALID_CREDENTIALS) return next(new HttpError(401, 'Unauthorized'));
|
||||
if (error) return next(new HttpError(500, error.message));
|
||||
|
||||
req.access_token = token; // used in logout route
|
||||
req.user = user;
|
||||
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user