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