meshblu-server-websocket
Version:
Websocket Protocol Adapter for Meshblu
20 lines (15 loc) • 581 B
text/coffeescript
class IdentityAuthenticateHandler
constructor: ({,,,}) ->
do: (data, callback=->) =>
{uuid, token} = data
return callback null, 'identify', metadata: {code: 204} unless uuid? && token?
request =
metadata:
jobType: 'Authenticate'
auth:
uuid: uuid
token: token
.do , , request, (error, response) =>
return callback error, 'identify' if error?
callback null, 'identity', response
module.exports = IdentityAuthenticateHandler