From 7757f97ce5f9d07ec5a0a42f9c1830daaaf42572 Mon Sep 17 00:00:00 2001 From: MD ARIF HOSSAIN Date: Sat, 29 Aug 2020 15:58:46 +0800 Subject: [PATCH] done --- middleware/authMiddleware.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;