From 8bbebcc0d978c827903145d5fa2673b2981a4458 Mon Sep 17 00:00:00 2001 From: Pawel Psztyc Date: Mon, 2 Oct 2017 15:47:18 -0700 Subject: [PATCH] Fix: Fixing issues with authorization. --- app.request.js | 2 +- auth.js | 4 ++-- bower.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app.request.js b/app.request.js index 3e17ec7..5b00178 100644 --- a/app.request.js +++ b/app.request.js @@ -269,7 +269,7 @@ class ArcRequest { * {Boolean} proxy Optional. True for proxy authentication. Default to false. */ set auth(opts) { - if (!opts.uid || !opts.passwd || !opts.method) { + if (!(opts.uid || opts.username) || !(opts.passwd || opts.password) || !opts.method) { console.warn('Invalid auth options. uid, passwd and method are required'); } opts.domain = opts.domain || undefined; diff --git a/auth.js b/auth.js index 089b9ac..f296fc9 100644 --- a/auth.js +++ b/auth.js @@ -7,9 +7,9 @@ class FetchAuth { constructor(opts) { // Login to authorize with - this.uid = opts.uid || undefined; + this.uid = opts.uid || opts.username || undefined; // Password to authorize with - this.passwd = opts.passwd || undefined; + this.passwd = opts.passwd || opts.password || undefined; // Aythentication method: basic, ntlm, digest (lowercase) this.method = opts.method || undefined; // Optional domain for authentication. diff --git a/bower.json b/bower.json index e4f8ae4..57e904f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "socket-fetch", - "version": "2.0.0-rc1", + "version": "2.0.0-rc2", "license": "LICENSE.txt", "description": "A HTTP transport based on chrome.socket.tcp API.", "authors": [