Skip to content

Commit

Permalink
Merge pull request bradtraversy#3 from KristinaChausheva/patch-1
Browse files Browse the repository at this point in the history
Update auth.js
  • Loading branch information
bradtraversy committed Jul 2, 2020
2 parents 676dbf7 + d6f214d commit 8d26c2e
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 8d26c2e

Please sign in to comment.