Files
nginx-proxy-manager/backend/lib/express/jwt.js
2024-04-19 11:42:01 +02:00

14 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();
};
};