Skip to content

Node.js based forum software built for the modern web

supply callback to req.session.destroy

Barış Soner Uşaklı662f92a4a82b
diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js
index e8ea4ff5b5..73eb6be287 100644
--- a/src/controllers/authentication.js
+++ b/src/controllers/authentication.js
@@ -418,8 +418,11 @@ authenticationController.logout = function (req, res, next) {
},
function (next) {
req.logout();
- req.session.destroy();
-
+ req.session.destroy(function (err) {
+ next(err);
+ });
+ },
+ function (next) {
user.setUserField(req.uid, 'lastonline', Date.now() - 300000, next);
},
function (next) {