const sessionUser = (req, res, next) => {
    if (req.session && req.session.user) {
      req.user = req.session.user; // Attach the session user to req.user
   
   //console.log("session user is22 :",req.user)
      return next();
    }
    console.log("session user is33 :",req.user)
    res.status(401).json({ message: 'Unauthorized: Please log in' });
  };
  
  module.exports = sessionUser;
  