title: Node.js Passport GoogleStrategy how to access session data
body: <p>I use <a href="https://github.com/jaredhanson/passport-google-oauth" rel="nofollow">Passport-Google-OAuth</a> to implement registration/login on my demo site. It works very well. Last several days I try to find solution how to access session variables inside "GoogleStrategy" implementation.</p>
  
  <pre><code>var GoogleStrategy = require('passport-google-oauth').OAuthStrategy;
  
  passport.use(new GoogleStrategy({
      consumerKey: GOOGLE_CONSUMER_KEY,
      consumerSecret: GOOGLE_CONSUMER_SECRET,
      callbackURL: "http://127.0.0.1:3000/auth/google/callback"
  },
  function(token, tokenSecret, profile, done) {
      // Is it possible to access to session variables here, eg.:
      // var tmp = req.session.tmp;
      User.findOrCreate({ googleId: profile.id }, function (err, user) {
          return done(err, user);
      });
  }));
  </code></pre>
  
  <p>I don't know is this possible. I need to update existing user in database, not to create new one, but can't "get" _id of existing user in this function.</p>