better dataPort security

montage-api
Moe 2021-12-21 12:03:56 -08:00
parent 55bec1a060
commit 3e3e2f6b58
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module.exports = function(s,config,lang,app,io){
setClientKillTimerIfNotAuthenticatedInTime(client)
function onAuthenticate(data){
clearKillTimer(client)
if(s.dataPortTokens[data]){
if(data in s.dataPortTokens){
client.removeListener('message', onAuthenticate);
client.on('message', onAuthenticatedData)
delete(s.dataPortTokens[data]);