I am working on a twitter API application and I need to use the user's access token and secret token to fetch their timeline
The twitter passport strategy gets me the tokens as follows:
passport.use(new Strategy({
consumerKey: '##################',
consumerSecret: '####################',
callbackURL: 'http://localhost:8000/twitter/callback'
}, function(token, tokenSecret, profile, callback){
return callback(null, profile);
}));
If I console.log(token) and tokensecret inside the function, I see the token in my console however I am trying to save these tokens to a global variable to use in my other .js file. I essentially need to plug it into this :
var client = new Twitter({
consumer_key: '###########',
consumer_secret: '################',
access_token_key: 'token',
access_token_secret: 'tokenSecret'
});
Is this possible or a way to do this?