Merge pull request #1015 from marcelklehr/fix/multiSession-foreach
Fix async.forEach in MultiSession code
This commit is contained in:
commit
cd3e65e043
1 changed files with 17 additions and 18 deletions
|
@ -123,8 +123,7 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
|
|||
}
|
||||
|
||||
var sessionIDs = sessionCookie.split(',');
|
||||
if (sessionIDs){
|
||||
async.forEach(sessionIDs, function(sessionID, cb){
|
||||
async.forEach(sessionIDs, function(sessionID, callback) {
|
||||
sessionManager.getSessionInfo(sessionID, function(err, sessionInfo) {
|
||||
//skip session if it doesn't exist
|
||||
if(err && err.message == "sessionID does not exist") return;
|
||||
|
@ -142,10 +141,10 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
|
|||
// There is a valid session
|
||||
validSession = true;
|
||||
sessionAuthor = sessionInfo.authorID;
|
||||
cb(); // finish the current value and go to next
|
||||
|
||||
callback();
|
||||
});
|
||||
}, callback)
|
||||
}
|
||||
}, callback);
|
||||
},
|
||||
//get author for token
|
||||
function(callback)
|
||||
|
|
Loading…
Reference in a new issue