Windshaft-cartodb/lib/api/middlewares/user.js
2019-10-07 09:58:21 +02:00

14 lines
283 B
JavaScript

'use strict';
const CdbRequest = require('../../models/cdb-request');
module.exports = function user () {
const cdbRequest = new CdbRequest();
return function userMiddleware(req, res, next) {
res.locals.user = cdbRequest.userByReq(req);
next();
};
};