From 3f1a47eccbf5e64b8b511c9c72b82db26e5d25f8 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 5 Jul 2016 14:54:26 +0100 Subject: [PATCH] map the 'retain' values to session ids --- .../web/app/coffee/Features/User/UserSessionsManager.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/app/coffee/Features/User/UserSessionsManager.coffee b/services/web/app/coffee/Features/User/UserSessionsManager.coffee index 547e8c9d96..571cfd7b8d 100644 --- a/services/web/app/coffee/Features/User/UserSessionsManager.coffee +++ b/services/web/app/coffee/Features/User/UserSessionsManager.coffee @@ -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)