const authMiddleware = (req, res, next) => {
    // Check if user is logged in
    if (req.cookies && req.cookies.isLoggedIn) {
        next(); // User is authenticated
    } else {
        res.redirect('/login'); // Redirect to login page
    }
};

module.exports = authMiddleware;
