nginx-proxy-manager/backend/lib/express/jwt.js
Zoey 906d7ce04a
update nginx/dep updates/fix eslint/change line endings
Signed-off-by: Zoey <zoey@z0ey.de>
2024-04-19 11:42:01 +02:00

13 lines
271 B
JavaScript

module.exports = function () {
return function (req, res, next) {
if (req.headers.authorization) {
const parts = req.headers.authorization.split(' ');
if (parts && parts[0] === 'Bearer' && parts[1]) {
res.locals.token = parts[1];
}
}
next();
};
};