diff --git a/middleware/authMiddleware.js b/middleware/authMiddleware.js index 8b4fc59..e2cb485 100644 --- a/middleware/authMiddleware.js +++ b/middleware/authMiddleware.js @@ -7,7 +7,7 @@ const requireAuth = (req, res, next) => { // check json web token exists and is verified if (token) { - jwt.verify(token, process.env.APP_SECRET, (err, decodedToken) => { + jwt.verify(token, process.env.SECRET_KEY, (err, decodedToken) => { if (err) { console.log(err.message); res.redirect('/login'); @@ -26,7 +26,7 @@ const checkUser = (req, res, next) => { const token = req.cookies.jwt; if (token) { - jwt.verify(token, process.env.APP_SECRET, async (err, decodedToken) => { + jwt.verify(token, process.env.SECRET_KEY, async (err, decodedToken) => { if (err) { console.log(err.message); res.locals.user = null;