Skip to content

Commit

Permalink
Fix token auth (henvo#5)
Browse files Browse the repository at this point in the history
* Fix token authentication

Fixes henvo#4

* Bump version
  • Loading branch information
Henning Vogt authored Oct 30, 2018
1 parent 27967f5 commit b692042
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ra-jsonapi-client",
"version": "0.4.1",
"version": "0.4.2",
"description": "JSON API data provider for react-admin.",
"main": "build/index.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/default-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ export default {
Accept: 'application/vnd.api+json; charset=utf-8',
'Content-Type': 'application/vnd.api+json; charset=utf-8',
},
auth: {},
};
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default (apiUrl, userSettings = {}) => (type, resource, params) => {

const options = {
headers: settings.headers,
auth: settings.auth,
};

switch (type) {
Expand Down
3 changes: 1 addition & 2 deletions src/initializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export default () => {
// When username and password are available use
// as basic auth credentials.
if (username && password) {
newConfig.auth.username = username;
newConfig.auth.password = password;
newConfig.auth = { username, password };
}

return newConfig;
Expand Down

0 comments on commit b692042

Please sign in to comment.