This commit is contained in:
Daniel García Aubert 2020-06-11 18:21:13 +02:00
parent 49735308de
commit 578f543c01

View File

@ -6,8 +6,10 @@ module.exports = function user (metadataBackend) {
const cdbRequest = new CdbRequest(); const cdbRequest = new CdbRequest();
return function userMiddleware (req, res, next) { return function userMiddleware (req, res, next) {
const { logger } = res.locals;
try { try {
res.locals.user = getUserNameFromRequest(req, cdbRequest); res.locals.user = getUserNameFromRequest(req, cdbRequest);
logger.info({ user: res.locals.user });
} catch (err) { } catch (err) {
return next(err); return next(err);
} }