title: Send info message from verify callback to client
body: <p>I am trying to send the info message that gets set in my verify callback:</p>
  
  <p>Here is the example from passport docs:</p>
  
  <pre><code>var passport = require('passport')
    , LocalStrategy = require('passport-local').Strategy;
  
  passport.use(new LocalStrategy(
    function(username, password, done) {
      User.findOne({ username: username }, function(err, user) {
        if (err) { return done(err); }
        if (!user) {
          return done(null, false, { message: 'Incorrect username.' });
        }
        if (!user.validPassword(password)) {
          return done(null, false, { message: 'Incorrect password.' });
        }
        return done(null, user);
      });
    }
  ));
  </code></pre>
  
  <p>However if I write my route as:</p>
  
  <pre><code>app.post('/login',
    passport.authenticate('local'),
    function(req, res) {
      // If this function gets called, authentication was successful.
      // `req.user` contains the authenticated user.
      res.redirect('/users/' + req.user.username);
    });
  </code></pre>
  
  <p>That function does not get called with the info message.  At least not that I know of.  I know passport shoves the user into the req, as I can access it from req.user.  Is there a way to access the info message like this.  Or do I need to specify a custom callback?</p>
  
  <p>Which they outline as:</p>
  
  <pre><code>app.get('/login', function(req, res, next) {
    passport.authenticate('local', function(err, user, info) {
      if (err) { return next(err); }
      if (!user) { return res.redirect('/login'); }
      req.logIn(user, function(err) {
        if (err) { return next(err); }
        return res.redirect('/users/' + user.username);
      });
    })(req, res, next);
  });
  </code></pre>
  
  <p>The part that is confusing is that they outline using a 3rd parameter in the done callback (from verify) that is a message, yet you can only access that if you write a custom callback.  Is that true.</p>