2024-10-04 18:43:08 -04:00
|
|
|
function loginRequired(req, res, next) {
|
2024-10-08 23:24:48 -04:00
|
|
|
//console.log("checkinig on req.session for auhetnticaion: ", req.session);
|
2024-10-04 18:43:08 -04:00
|
|
|
if (!req.session.name) {
|
|
|
|
return res.status(401).json({"error": "need to be logged in for that bucko"});
|
|
|
|
}
|
|
|
|
|
|
|
|
next();
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { loginRequired };
|