Skip to content

Commit

Permalink
Fix req.logout() - new version of Passport
Browse files Browse the repository at this point in the history
  • Loading branch information
netmagik committed Aug 29, 2022
1 parent 2679f8a commit 20690a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ router.get(

// @desc Logout user
// @route /auth/logout
router.get('/logout', (req, res) => {
req.logout()
res.redirect('/')
router.get('/logout', (req, res, next) => {
req.logout((error) => {
if (error) {return next(error)}
res.redirect('/')
})
})

module.exports = router

0 comments on commit 20690a3

Please sign in to comment.