title: How to access data sent via next parameter in express middleware
body: <p>I am running an express server and came across a middleware problem with passport authenticate which is something like this</p>
  
  <pre><code>passport.use('google', new GoogleStratergy({
      clientID:     "",
      clientSecret: "",
      callbackURL: "/Users/auth/google/callback",
      passReqToCallback   : true
  }, (request, accessToken, refreshToken, profile, done) =&gt; {
      Users.findOne({ UserID: profile.id }, function (err, user) {
          if (err){
              return done(err);
          }
          if (!user){
              var User = new Users({});
              User.setPassword(Math.random().toString(36).substring(5));
  
              var jwt = User.generateJWT();
  
              User.save()
                  .then(() =&gt; {
                      return done(null, User, jwt);
                  })
                  .catch(err =&gt; {
                      return done(err);
                  })
          }
          else {
              var jwt = user.generateJWT();
              return done(null, user, jwt);
          }
      });
    }
  ));
  </code></pre>
  
  <p>just now I don't know how to access the objects passed in the done function when using the middleware in another route like this.</p>
  
  <pre><code>router.get('/something', passport.authenticate('google'), (req, res, next) =&gt; {
      // Now I need to access User and jwt object here passed with done()
      res.send("whatever");
  })
  </code></pre>