const hasToken = (req, res, next) => { // get token const token = req.cookies.JWT_TOKEN; if (!token) { // if none, error return res.status(403).json({ message: "Token not found!", }); } return next(); }; module.exports = hasToken;