Get anonToken from joinProject payload

This commit is contained in:
Shane Kilkelly 2017-09-29 16:32:46 +01:00
parent d4c735c3ea
commit 438bb28c04

View file

@ -67,9 +67,8 @@ module.exports = Router =
user = {_id: "anonymous-user"}
client.on "joinProject", (data = {}, callback) ->
anonToken = session?.anonReadOnlyTokenAccess?[data.project_id]
if anonToken
user.anonToken = anonToken
if data.anonToken
user.anonToken = data.anonToken
WebsocketController.joinProject client, user, data.project_id, (err, args...) ->
if err?
Router._handleError callback, err, client, "joinProject", {project_id: data.project_id, user_id: user?.id}