node.js - Passport Not calling callback -


using passport first time , realize when log data inside strategy callback doesn't displayed in console, how works or doing wrong?

passport.use(new googlestrategy({   clientid: process.env.google_client_id,   clientsecret: process.env.google_client_secret,   callbackurl: process.env.callback_url,   passreqtocallback: true }, function (accesstoken, refreshtoken, profile, done) {     console.log('this should displayed');     done(profile)   } ); 

route looks this:

app.get('/api/v1/authenticate/google', passport.authenticate('google', { scope: ['https://www.googleapis.com/auth/plus.login'] })); 

i had same issue , solved calling authenticate this:

passport.authenticate('facebook', {     scope: ['email', 'public_profile', 'user_likes', 'user_birthday'],     callbackurl: "http://localhost:1337" + req.url }, function (err, user) {     if (err) return res.negotiate(err);     // })(req, res, next); 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -