Skip to content

Commit

Permalink
Merge pull request #12 from arifpro/developer
Browse files Browse the repository at this point in the history
done
  • Loading branch information
arifpro authored Aug 29, 2020
2 parents 3d51ac1 + 7757f97 commit 3111cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions middleware/authMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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;
Expand Down

0 comments on commit 3111cdf

Please sign in to comment.