diff --git a/lib/couchdb.js b/lib/couchdb.js
index <HASH>..<HASH> 100644
--- a/lib/couchdb.js
+++ b/lib/couchdb.js
@@ -171,7 +171,9 @@ CouchDB.prototype.client = function (method, path, data, callback) {
     }
 
     if (this.instance.auth) {
-        var enc = new Buffer(this.instance.auth).toString('base64');
+        var enc = new Buffer(
+            decodeURIComponent(this.instance.auth)
+        ).toString('base64');
         headers.Authorization = "Basic " + enc;
     }
properly decode URI components in URL auth details before adding to Basic Auth headers