diff --git a/src/controllers/authentication.js b/src/controllers/authentication.js index 04a9e1408c..560965f8ec 100644 --- a/src/controllers/authentication.js +++ b/src/controllers/authentication.js @@ -306,6 +306,8 @@ authenticationController.logout = function(req, res, next) { } req.logout(); + user.setUserField(uid, 'lastonline', Date.now() - 300000); + // action:user.loggedOut deprecated in > v0.9.3 plugins.fireHook('action:user.loggedOut', {req: req, res: res, uid: uid}); plugins.fireHook('static:user.loggedOut', {req: req, res: res, uid: uid}, function() { diff --git a/src/user/auth.js b/src/user/auth.js index 99bdfb8c94..f2fa917962 100644 --- a/src/user/auth.js +++ b/src/user/auth.js @@ -1,10 +1,10 @@ 'use strict'; -var async = require('async'), - winston = require('winston'), - db = require('../database'), - meta = require('../meta'), - events = require('../events'); +var async = require('async'); +var winston = require('winston'); +var db = require('../database'); +var meta = require('../meta'); +var events = require('../events'); module.exports = function(User) { User.auth = {};