From af170334bdd02e39882a88a7cbd9690d5bc78606 Mon Sep 17 00:00:00 2001 From: Idan Gazit Date: Thu, 10 Dec 2015 17:21:31 +0200 Subject: [PATCH] Dropping support for auth.user/pass Only accept `username` and `password` as arguments --- README.md | 6 ++---- lib/adapters/xhr.js | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 42131346fc..ae390cc94f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 61e927f918..2615c108cc 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -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