multy-stub/.bzr/legacy/webstar-project/middleware/auth-middleware.js
Primakov Alexandr Alexandrovich 270fe51500 move old to legacy folder
2025-01-19 21:13:33 +03:00

15 lines
303 B
JavaScript

const authMiddleware = (req, res, next) => {
const email = (req.headers.authorization || "").replace("Bearer ", "");
if (email) {
req.userEmail = email;
next();
} else {
return res.status(403).json({
message: "Access Denied",
});
}
};
module.exports = authMiddleware