 JSON_HEADERS =
   'Content-Type': 'application/json'
   'Accept': 'application/json'
-
-ADD_CREDENTIALS = (request) ->
-  request.withCredentials = true
 
 # This will match the CSRF token in a string of HTML.
 # TODO: Get JSON instead.

        client_id: config.clientAppID

      console?.log 'Requesting a new bearer token'
      makeHTTPRequest 'POST', config.host + '/oauth/token', data, JSON_HEADERS, ADD_CREDENTIALS
        .then (request) =>
          response = JSON.parse request.responseText
          @bearerToken = response.access_token

          email: email
          password: password

      makeHTTPRequest 'POST', config.host + '/users', data, JSON_HEADERS
        .then (request) =>
          # The response contains a JSON-API "users" resource.
          client.processResponseTo request
