use anonymous function instead of arrow function in middleware export to don't bind this
This commit is contained in:
parent
521b441da5
commit
8867cdbc02
@ -1,10 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = () => function apikeyTokenMiddleware(req, res, next) {
|
||||
const apikeyCredentials = getApikeyCredentialsFromRequest(req);
|
||||
res.locals.api_key = apikeyCredentials.token;
|
||||
res.locals.apikeyUsername = apikeyCredentials.username;
|
||||
return next();
|
||||
module.exports = function() {
|
||||
return function apikeyTokenMiddleware(req, res, next) {
|
||||
const apikeyCredentials = getApikeyCredentialsFromRequest(req);
|
||||
res.locals.api_key = apikeyCredentials.token;
|
||||
res.locals.apikeyUsername = apikeyCredentials.username;
|
||||
return next();
|
||||
};
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user