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 };