mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #570 from sharelatex/ho-null-check-redis-sessions
Ho null check redis sessions
This commit is contained in:
commit
a58a715fad
2 changed files with 5 additions and 4 deletions
|
@ -120,6 +120,7 @@ module.exports = UserController =
|
||||||
req.session.destroy (err)->
|
req.session.destroy (err)->
|
||||||
if err
|
if err
|
||||||
logger.err err: err, 'error destorying session'
|
logger.err err: err, 'error destorying session'
|
||||||
|
if user?
|
||||||
UserSessionsManager.untrackSession(user, sessionId)
|
UserSessionsManager.untrackSession(user, sessionId)
|
||||||
SudoModeHandler.clearSudoMode(user._id)
|
SudoModeHandler.clearSudoMode(user._id)
|
||||||
res.redirect '/login'
|
res.redirect '/login'
|
||||||
|
|
|
@ -114,7 +114,7 @@ module.exports = UserSessionsManager =
|
||||||
callback(null)
|
callback(null)
|
||||||
|
|
||||||
touch: (user, callback=(err)->) ->
|
touch: (user, callback=(err)->) ->
|
||||||
if !user
|
if !user?
|
||||||
logger.log {}, "no user to touch sessions for, returning"
|
logger.log {}, "no user to touch sessions for, returning"
|
||||||
return callback(null)
|
return callback(null)
|
||||||
sessionSetKey = UserSessionsRedis.sessionSetKey(user)
|
sessionSetKey = UserSessionsRedis.sessionSetKey(user)
|
||||||
|
@ -125,7 +125,7 @@ module.exports = UserSessionsManager =
|
||||||
callback(null)
|
callback(null)
|
||||||
|
|
||||||
_checkSessions: (user, callback=(err)->) ->
|
_checkSessions: (user, callback=(err)->) ->
|
||||||
if !user
|
if !user?
|
||||||
logger.log {}, "no user, returning"
|
logger.log {}, "no user, returning"
|
||||||
return callback(null)
|
return callback(null)
|
||||||
logger.log {user_id: user._id}, "checking sessions for user"
|
logger.log {user_id: user._id}, "checking sessions for user"
|
||||||
|
|
Loading…
Reference in a new issue