Skip to content

Commit

Permalink
Dropping support for auth.user/pass
Browse files Browse the repository at this point in the history
Only accept `username` and `password` as arguments
  • Loading branch information
idan committed Dec 10, 2015
1 parent 3138600 commit af17033
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions README.md
Expand Up @@ -218,11 +218,9 @@ These are the available config options for making requests. Only the `url` is re
// `auth` indicates that HTTP Basic auth should be used, and supplies credentials.
// This will set an `Authorization` header, overwriting any existing
// `Authorization` custom headers you have set using `headers`.
// The username can be supplied as `user` or `username`
// The password can be supplied as `pass` or `password`
auth: {
user: 'janedoe',
pass: 's00pers3cret'
username: 'janedoe',
password: 's00pers3cret'
}

// `responseType` indicates the type of data that the server will respond with
Expand Down
4 changes: 2 additions & 2 deletions lib/adapters/xhr.js
Expand Up @@ -41,9 +41,9 @@ module.exports = function xhrAdapter(resolve, reject, config) {

// HTTP basic authentication
if (config.auth) {
var username = config.auth.user || config.auth.username || '';
var password = config.auth.pass || config.auth.password || '';
requestHeaders['Authorization'] = 'Basic: ' + window.btoa(username + ':' + password);
var username = config.auth.username || '';
var password = config.auth.password || '';
}

// Create the request
Expand Down

0 comments on commit af17033

Please sign in to comment.