From 662f92a4a82b8c49667f0b60ba1a92a7a73ae780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 2 Nov 2017 18:21:25 -0400 Subject: [PATCH] supply callback to req.session.destroy --- src/controllers/authentication.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) {