From 36e1b2ba085d423517d36932d87b9309b115ddf2 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 11 Apr 2017 14:48:19 +0100 Subject: [PATCH] Don't process subscription for unauthenticated comms link Fixes #851 --- red/api/comms.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); - } } } });