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