Closed waflessnet closed 8 years ago
You can choose between the sails way http://sailsjs.org/documentation/concepts/configuration or using environment variables.
passport.use(new TwitterStrategy({
consumerKey: process.env.TWITTER_KEY,
consumerSecret: process.env.TWITTER_SECRET,
callbackURL: 'http://localhost:1337/auth/twitter/callback'
}, verifyHandler));
Now, the magic happens when you run the application like this
TWITTER_KEY=123 TWITTER_SECRET=456 sails lift
Ok, but the idea is before login, select a parameter, then based on this select the appropriate tokens in the database. Is change tokens in time execute.
The parameters is selected before login, it´s param save in 'req.session'. by it want to use req.session Thanks !
I'm not sure if this is possible and how you could do that. Your questions is how to plug-in a middleware at run-time. Ask the maintainer if and how this is possible. Good luck
Hi, how can use 'req.session' in the file passorpt, i want do dynamic
passport.use(new TwitterStrategy({ consumerKey: req.session.client_id, consumerSecret:req.session.client_secret, callbackURL: 'http://localhost:1337/auth/twitter/callback' }, verifyHandler));
Thanks!