Skip to content

Commit

Permalink
Update auth.js
Browse files Browse the repository at this point in the history
req object in ensureGuest middleware was null - this is how i fixed it
  • Loading branch information
KristinaChausheva committed Jul 1, 2020
1 parent 676dbf7 commit d6f214d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module.exports = {
}
},
ensureGuest: function (req, res, next) {
if (req.isAuthenticated()) {
res.redirect('/dashboard')
if (!req.isAuthenticated()) {
return next();
} else {
return next()
res.redirect('/dashboard');
}
},
}

0 comments on commit d6f214d

Please sign in to comment.