diff --git a/src/controllers/main.js b/src/controllers/main.js index 4b3c71b63..3eac39894 100644 --- a/src/controllers/main.js +++ b/src/controllers/main.js @@ -192,9 +192,10 @@ mainController.l2AuthPost = function (req, res, next) { mainController.logout = function (req, res) { req.session.l2auth = null req.session.destroy(function () { - req.logout() - res.clearCookie('connect.sid') - return res.redirect('/') + req.logout(function () { + res.clearCookie('connect.sid') + return res.redirect('/') + }) }) }