9cd67f06c1
Used only where potentially a user is required. It doesn't make sense to extract a user for request that don't need a user in the context.
8 lines
211 B
JavaScript
8 lines
211 B
JavaScript
var CdbRequest = require('../models/cdb_request');
|
|
var cdbRequest = new CdbRequest();
|
|
|
|
module.exports = function userMiddleware(req, res, next) {
|
|
req.context.user = cdbRequest.userByReq(req);
|
|
next();
|
|
};
|