title: Passport js local strategy custom callback "Missing credentials"
body: <p>I have a really annoying problem with Node js, express 4 and passport. I have tried all options I can think of, but still no solution. Couldn't find a solution from other posts for this problem.</p>
  
  <p>Code:</p>
  
  <pre><code>app.post('/login', function(req, res, next) {
  
      console.log(req.body.user_email);
      console.log(req.body.user_password);
  
      passport.authenticate('local', function(err, user, info) {
  
          console.log(info);
  ...
  </code></pre>
  
  <p>The problem is that for some reason, passport does not get the credentials and says at the console.log(info) "Missing credentials", although when the username and password are logged above they are correct. The local strategy should also be configured properly:</p>
  
  <pre><code>passport.use(new LocalStrategy ({
  
      usernameField: 'user_email',
      passwordField: 'user_password',
      },
  
      function(username, password, done) {
  
          console.log(username);
          console.log(password);
  ...
  </code></pre>
  
  <p>The "function(username, password, done)" never gets run, because of the "Missing credentials".</p>
  
  <p>The funny part is that from another html/ejs page where a call for authentication is made with:</p>
  
  <pre><code>app.post('/login_user', passport.authenticate('local', { successRedirect: '/loginSuccess', failureRedirect: '/loginFailure' }));
  </code></pre>
  
  <p>the problem does not exist.</p>
  
  <p>Does anybody know what I am missing here?!?!</p>
  
  <p>Thanks!</p>