the-forest/server/authStuff.js

10 lines
276 B
JavaScript

function loginRequired(req, res, next) {
//console.log("checkinig on req.session for auhetnticaion: ", req.session);
if (!req.session.name) {
return res.status(401).json({"error": "need to be logged in for that bucko"});
}
next();
}
module.exports = { loginRequired };