mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-23 01:12:27 +00:00
map the 'retain' values to session ids
This commit is contained in:
parent
2caa80bbcb
commit
3f1a47eccb
1 changed files with 2 additions and 1 deletions
|
@ -61,6 +61,7 @@ module.exports = UserSessionsManager =
|
|||
revokeAllUserSessions: (user, retain, callback=(err)->) ->
|
||||
if !retain
|
||||
retain = []
|
||||
retain = retain.map((i) -> UserSessionsManager._sessionKey(i))
|
||||
if !user
|
||||
logger.log {}, "no user to revoke sessions for, returning"
|
||||
return callback(null)
|
||||
|
@ -70,7 +71,7 @@ module.exports = UserSessionsManager =
|
|||
if err
|
||||
logger.err {err, user_id: user._id, sessionSetKey}, "error getting contents of UserSessions set"
|
||||
return callback(err)
|
||||
keysToDelete = _.filter(sessionKeys, (k) => k not in retain)
|
||||
keysToDelete = _.filter(sessionKeys, (k) -> k not in retain)
|
||||
logger.log {user_id: user._id, count: keysToDelete.length}, "deleting sessions for user"
|
||||
rclient.multi()
|
||||
.del(keysToDelete)
|
||||
|
|
Loading…
Reference in a new issue