fix: Check if user is authenticated

master
Miguel Gonzalez 2018-04-26 11:48:00 +02:00
parent 2efba0baf9
commit 38b608ec5c
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class Client
else if msg.cmd == 'auth' and msg.data else if msg.cmd == 'auth' and msg.data
@.authUser(msg.data) @.authUser(msg.data)
else if msg.cmd == 'subscribe' and msg.routing_key else if msg.cmd == 'subscribe' and msg.routing_key
if msg.routing_key.indexOf("live_notifications") == 0 if @.auth and msg.routing_key.indexOf("live_notifications") == 0
userId = signing.getUserId(@.auth.token) userId = signing.getUserId(@.auth.token)
@.addSubscription("live_notifications.#{userId}") @.addSubscription("live_notifications.#{userId}")
else else