dont crash on no auth, ust a bandaid
This commit is contained in:
parent
f478f99995
commit
3b8621c6a0
|
@ -224,6 +224,14 @@ exports.handleMessage = function(client, message)
|
|||
// FIXME: Call our "sessions" "connections".
|
||||
// FIXME: Use a hook instead
|
||||
// FIXME: Allow to override readwrite access with readonly
|
||||
|
||||
// FIXME: A message might arrive but wont have an auth object, this is obviously bad so we should deny it
|
||||
// Simulate using the load testing tool
|
||||
if(!sessioninfos[client.id].auth){
|
||||
console.error("Auth was never applied to a session", sessioninfos[client.id])
|
||||
client.json.send({accessStatus: "deny"});
|
||||
callback();
|
||||
}else{
|
||||
var auth = sessioninfos[client.id].auth;
|
||||
securityManager.checkAccess(auth.padID, auth.sessionID, auth.token, auth.password, function(err, statusObject)
|
||||
{
|
||||
|
@ -240,6 +248,7 @@ exports.handleMessage = function(client, message)
|
|||
client.json.send({accessStatus: statusObject.accessStatus})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
finalHandler
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue