   server: meshbluConfig.server
   port: meshbluConfig.port
 
-# app.use meshbluAuth meshbluOptions
+meshbluAuthorizer = meshbluAuth meshbluOptions
 
 app.options '*', cors()
 

  req.session.token = token
  next null, uuid: profile.uuid

app.post '/api/proxy', (req, res) ->
  clientID = req.body.clientID
  uri = req.body.uri
  qs  = req.body.qs

    else
      meshbluHttp.register
        type: 'auth:little-bits-cloud-proxy'
        configureWhitelist: [octobluStrategyConfig.clientID]
        discoverWhitelist: [octobluStrategyConfig.clientID]
        clientID: clientID
        clientSecret: clientSecret
        meshblu:
          messageForward: [octobluStrategyConfig.clientID]
      , (error, device) ->
        meshbluHttp.register
          type: 'auth:user:little-bits-cloud-proxy'
          configureWhitelist: [userUuid]
          discoverWhitelist: [octobluStrategyConfig.clientID, userUuid]
          parentDevice: device.uuid
          meshblu:
            messageForward: [device.uuid]
        , (error, userDevice) ->
          meshbluHttp.update device.uuid, sendWhitelist: [userDevice.uuid]

app.get '/', passport.authenticate('octoblu')
app.get '/api/octoblu/callback', passport.authenticate('octoblu'), (req, res) ->
