File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,17 @@ util.inherits(Strategy, passport.Strategy);
68
68
*/
69
69
Strategy . prototype . authenticate = function ( req , options ) {
70
70
options = options || { } ;
71
- var username = lookup ( req . body , this . _usernameField ) || lookup ( req . query , this . _usernameField ) ;
72
- var password = lookup ( req . body , this . _passwordField ) || lookup ( req . query , this . _passwordField ) ;
71
+ var username = lookup ( req . body , this . _usernameField )
72
+ if ( username === null ) {
73
+ lookup ( req . query , this . _usernameField ) ;
74
+ }
75
+
76
+ var password = lookup ( req . body , this . _passwordField )
77
+ if ( password === null ) {
78
+ password = lookup ( req . query , this . _passwordField ) ;
79
+ }
73
80
74
- if ( ! username || ! password ) {
81
+ if ( username === null || password === null ) {
75
82
return this . fail ( { message : options . badRequestMessage || 'Missing credentials' } , 400 ) ;
76
83
}
77
84
You can’t perform that action at this time.
0 commit comments