From 7202282048bec2a146bb042e7533c7c14ff9dd99 Mon Sep 17 00:00:00 2001 From: relativityboy Date: Mon, 25 Feb 2019 19:52:31 -0600 Subject: [PATCH 1/2] Resolve issue #180 --- lib/strategy.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/strategy.js b/lib/strategy.js index 04172bb..879aa55 100644 --- a/lib/strategy.js +++ b/lib/strategy.js @@ -68,10 +68,17 @@ util.inherits(Strategy, passport.Strategy); */ Strategy.prototype.authenticate = function(req, options) { options = options || {}; - var username = lookup(req.body, this._usernameField) || lookup(req.query, this._usernameField); - var password = lookup(req.body, this._passwordField) || lookup(req.query, this._passwordField); + var username = lookup(req.body, this._usernameField) + if(username === null) { + lookup(req.query, this._usernameField); + } + + var password = lookup(req.body, this._passwordField) + if(password === null) { + password = lookup(req.query, this._passwordField); + } - if (!username || !password) { + if (username === null || password === null) { return this.fail({ message: options.badRequestMessage || 'Missing credentials' }, 400); } From b6131e195f5878064192e5baa9703f3b3587f293 Mon Sep 17 00:00:00 2001 From: relativityboy Date: Mon, 25 Feb 2019 19:53:02 -0600 Subject: [PATCH 2/2] Version bump for #180 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f77ea9c..760fb16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "passport-local", - "version": "1.0.0", + "version": "1.0.1", "description": "Local username and password authentication strategy for Passport.", "keywords": [ "passport",