diff --git a/red/api/comms.js b/red/api/comms.js index cb785e239..6f5618ecf 100644 --- a/red/api/comms.js +++ b/red/api/comms.js @@ -132,14 +132,14 @@ function start() { if (anonymousUser) { log.audit({event: "comms.auth",user:anonymousUser}); completeConnection(anonymousUser.permissions,false); + //TODO: duplicated code - pull non-auth message handling out + if (msg.subscribe) { + handleRemoteSubscription(ws,msg.subscribe); + } } else { log.audit({event: "comms.auth.fail"}); completeConnection(null,false); } - //TODO: duplicated code - pull non-auth message handling out - if (msg.subscribe) { - handleRemoteSubscription(ws,msg.subscribe); - } } } });