hoodiehq/hoodie.js — pull request #323 by michielbdejong (2014-06-09 17:10:28+00:00)
Title: bearer token support

This PR does two simple things:
* look for an 'authToken' field in the sign-in response, and
store this as hoodie.account.authToken
* send an 'Authorization' header with 'Bearer ' + that token in
each request to the hoodie-server.

This PR goes together with https://github.com/hoodiehq/hoodie-server/pull/288
on the hoodie-server repo, which at the HAPI level, will:
* strip the couchdb cookie and add it into the JSON response of
signIn requests.
* read the Authorization header to look for a token of the form
'Bearer ...', and create a cookie header from the '...', to
send to the couchdb layer.