res.locals forgotten things and make jshint happy

This commit is contained in:
Simon Martín
2017-09-29 14:38:28 +02:00
parent 482feabce2
commit c22a35489d
4 changed files with 12 additions and 4 deletions
@@ -1,5 +1,3 @@
const _ = require('underscore');
module.exports = function authorizeMiddleware (authApi) {
return function (req, res, next) {
req.profiler.done('req2params.setup');
+1 -1
View File
@@ -1,4 +1,4 @@
const locals = require('./locals')
const locals = require('./locals');
const cleanUpQueryParams = require('./clean-up-query-params');
const layergroupToken = require('./layergroup-token');
const authorize = require('./authorize');
+4
View File
@@ -1,7 +1,11 @@
const _ = require('underscore');
module.exports = function layergroupTokenMiddleware(req, res, next) {
// FIXME: Temporary hack to share data between middlewares. Express overrides req.params to
// parse url params to an object and it's performed after matching path and controller.
res.locals = {};
_.extend(res.locals, req.params);
next();
}