I would like to add the feature that will allow the middleware(s) configured in settings.js for httpAdminMiddleware
and ui.middleware
to allow for an array of functions instead of just a single function.
This will make it easier to use various 3rd party middlewares, with a simple example being cookie-parser
. This will allow for a middleware configuration as:
httpAdminMiddleware: [
cookieParser('some_secret'),
(req, res, next) => {
// act upon the retrieved cookies
if (req.signedCookies.mycookie === 'some_value') {
return next();
}
next(new Error('access denied'));
]
If there are no objections, I will make the pull requests. It is a simple matter of adding
|| Array.isArray(middleware)