v1.18.x
barisusakli 9 years ago
parent cf889b70bd
commit 9a5b308015

@ -120,8 +120,17 @@ module.exports = function(User) {
winston.verbose('[user.auth] Revoking session ' + sessionId + ' for user ' + uid); winston.verbose('[user.auth] Revoking session ' + sessionId + ' for user ' + uid);
db.sessionStore.get(sessionId, function(err, sessionObj) { db.sessionStore.get(sessionId, function(err, sessionObj) {
if (err) {
return callback(err);
}
async.parallel([ async.parallel([
async.apply(db.deleteObjectField, 'uid:' + uid + ':sessionUUID:sessionId', sessionObj.meta.uuid), function (next) {
if (sessionObj && sessionObj.meta && sessionObj.meta.uuid) {
db.deleteObjectField('uid:' + uid + ':sessionUUID:sessionId', sessionObj.meta.uuid, next);
} else {
next();
}
},
async.apply(db.sortedSetRemove, 'uid:' + uid + ':sessions', sessionId), async.apply(db.sortedSetRemove, 'uid:' + uid + ':sessions', sessionId),
async.apply(db.sessionStore.destroy.bind(db.sessionStore), sessionId) async.apply(db.sessionStore.destroy.bind(db.sessionStore), sessionId)
], callback); ], callback);

Loading…
Cancel
Save