diff --git a/lib/auth/index.js b/lib/auth/index.js index fcc39a2a4..51bc43cb7 100644 --- a/lib/auth/index.js +++ b/lib/auth/index.js @@ -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 + '/') + }) })