Skip to content

Commit

Permalink
fix: logout api should add callback
Browse files Browse the repository at this point in the history
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
  • Loading branch information
Yukaii committed Dec 26, 2023
1 parent 070808b commit db705b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ authRouter.get('/logout', function (req, res) {
if (config.debug && req.isAuthenticated()) {
logger.debug('user logout: ' + req.user.id)
}
req.logout()
res.redirect(config.serverURL + '/')

req.logout((err) => {
if (err) { return next(err) }

res.redirect(config.serverURL + '/')
})
})

0 comments on commit db705b2

Please sign in to comment.