mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-05 23:01:10 +00:00
null check user during logout
This commit is contained in:
parent
35f31d5a3c
commit
33fe252a15
1 changed files with 3 additions and 2 deletions
|
@ -120,8 +120,9 @@ module.exports = UserController =
|
|||
req.session.destroy (err)->
|
||||
if err
|
||||
logger.err err: err, 'error destorying session'
|
||||
UserSessionsManager.untrackSession(user, sessionId)
|
||||
SudoModeHandler.clearSudoMode(user._id)
|
||||
if user?
|
||||
UserSessionsManager.untrackSession(user, sessionId)
|
||||
SudoModeHandler.clearSudoMode(user._id)
|
||||
res.redirect '/login'
|
||||
|
||||
register : (req, res, next = (error) ->)->
|
||||
|
|
Loading…
Reference in a new issue