From e479fad792286c77d02ebd58e41b2116d97794c5 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 5 Apr 2019 11:57:55 -0400 Subject: [PATCH] fix: #7517 --- 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 cd53113016..ba0d3da0d1 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -389,6 +389,9 @@ authenticationController.onSuccessfulLogin = function (req, uid, callback) { function (next) { user.updateLastOnlineTime(uid, next); }, + function (next) { + user.updateOnlineUsers(uid, next); + } ], function (err) { next(err); }); @@ -498,7 +501,7 @@ authenticationController.logout = function (req, res, next) { user.setUserField(uid, 'lastonline', Date.now() - (meta.config.onlineCutoff * 60000), next); }, function (next) { - db.sortedSetRemove('users:online', uid, next); + db.sortedSetAdd('users:online', Date.now() - (meta.config.onlineCutoff * 60000), uid, next); }, function (next) { plugins.fireHook('static:user.loggedOut', { req: req, res: res, uid: uid, sessionID: sessionID }, next);