title: Pass user info in routes from Passport strategies
body: <p>I am trying to authenticate user using passportjs using express.</p>
  
  <p>Passport.js looks like this.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var USER_INFO = {};
  var FB_CALLBACK = 'http://localhost:3000/auth/facebook/callback';
  module.exports = function(passport) {
   passport.use(new FacebookStrategy({
    clientID: FB_CLIENT_ID,
    clientSecret: FB_CLIENT_SECRET,
    callbackURL: FB_CALLBACK
   }, 
   function(accessToken, refreshToken, profile, done) {
    process.nextTick(function() {
     USER_INFO.id = profile.id;
    });
   }));
  }</code></pre>
  </div>
  </div>
  </p>
  
  <pre class="lang-js prettyprint-override"><code>var express = require('express'); // call express
  var app = express(); // define our app using express
  var router = express.Router(); // get an instance of the express Route
  var passport = require('passport');
  USER_INFO = {};
  require('./config/passport')(passport);
  app.get('/auth/facebook', passport.authenticate('facebook'));
  
  app.get('/auth/facebook/callback', passport.authenticate('facebook', {
      successRedirect : '/fb',
      failureRedirect : '/error'
  }));
  
  app.get('/fb', function (req, res) {
      res.json(USER_INFO);
  }); 
  </code></pre>
  
  
  
  <p>I want all the information extracted in res.json(user_info). But it is coming as empty. What I am missing here. What is the best method to save user basic info of user to keep him logged in.</p>