From 7064fd0678460b77603e07de96e398584231140b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 24 Jan 2019 15:14:12 -0500 Subject: [PATCH] fix: #7235 --- src/controllers/authentication.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index d4bf9620aa..31b59eee93 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -478,7 +478,10 @@ authenticationController.logout = function (req, res, next) { }); }, function (next) { - user.setUserField(req.uid, 'lastonline', Date.now() - 300000, next); + user.setUserField(req.uid, 'lastonline', Date.now() - (meta.config.onlineCutoff * 60000), next); + }, + function (next) { + db.sortedSetRemove('users:online', req.uid, next); }, function (next) { plugins.fireHook('static:user.loggedOut', { req: req, res: res, uid: req.uid }, next);