Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
feat(API): use Authorization: Bearer xxx instead of `X-Session-ID: …
Browse files Browse the repository at this point in the history
…xxx` header
  • Loading branch information
Sjors committed May 31, 2016
1 parent 92f4989 commit cb1ffe2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ API.prototype.encodeFormData = function (data) {

////////////////////////////////////////////////////////////////////////////////
// Permitted extra headers:
// sessionToken -> "X-Session-ID"
// sessionToken -> "Authorization Bearer <token>"
API.prototype.request = function (action, method, data, extraHeaders) {
var url = this.ROOT_URL + method
var body = data ? this.encodeFormData(data) : ''
Expand All @@ -45,7 +45,7 @@ API.prototype.request = function (action, method, data, extraHeaders) {

if(extraHeaders) {
if(extraHeaders.sessionToken) {
options.headers['X-Session-ID'] = extraHeaders.sessionToken;
options.headers['Authorization'] = 'Bearer ' + extraHeaders.sessionToken;
}
}

Expand Down

0 comments on commit cb1ffe2

Please sign in to comment.