From 0a79f407abfb56c5ae8856092957e8b91897fcf3 Mon Sep 17 00:00:00 2001 From: Christian Dannie Storgaard Date: Thu, 20 Nov 2014 18:47:35 +0200 Subject: [PATCH] Fixed credentials breaking on passwords containing the character ':'. --- lib/passport-http/strategies/basic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/passport-http/strategies/basic.js b/lib/passport-http/strategies/basic.js index 5b1f049..fd91938 100644 --- a/lib/passport-http/strategies/basic.js +++ b/lib/passport-http/strategies/basic.js @@ -77,8 +77,8 @@ BasicStrategy.prototype.authenticate = function(req) { if (!/Basic/i.test(scheme)) { return this.fail(this._challenge()); } if (credentials.length < 2) { return this.fail(400); } - var userid = credentials[0]; - var password = credentials[1]; + var userid = credentials.shift(); + var password = credentials.join(':'); if (!userid || !password) { return this.fail(this._challenge()); }