I need to get access to req
object in success callback of Twitter Passport:
passport.use(new TwitterStrategy({
consumerKey: TWITTER_CONSUMER_KEY,
consumerSecret: TWITTER_CONSUMER_SECRET,
callbackURL: "http://127.0.0.1:3000/auth/twitter/callback"
},
function(token, tokenSecret, profile, done) {
//here I need `req` object
}
));
How can I access to that in success callback scope?
Ok, found the answer. You need to set
passReqToCallback: true
in options, then the first parameter of callback will bereq
object:https://github.com/jaredhanson/passport/issues/39