jaredhanson / passport-facebook

Facebook authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-facebook/?utm_source=github&utm_medium=referral&utm_campaign=passport-facebook&utm_content=about
MIT License
1.29k stars 446 forks source link

Redirection to facebook #264

Open Faisalaliarain opened 4 years ago

Faisalaliarain commented 4 years ago

I am trying to authenticate facbook login but dialogue is not apprearing to login or neither its redirecting to facebook login page its just keep on spinning and request time out.

//Strategy const passport = require('passport') , FacebookStrategy = require('passport-facebook').Strategy; const strategy = new FacebookStrategy({ clientID: FACEBOOK_APP_ID, clientSecret: FACEBOOK_APP_SECRET, callbackURL: FACEBOOK_CALLBACK_URL, enableProof: true }, (accessToken, refreshToken, profile, done) => { console.log(profile); }); passport.use(strategy); // my routes router.get('/auth/facebook',fbController.facebookLogin); router.get('auth/facebook/callback',fbController.fbRedirection); // controller methods const facebookLogin = async (req, res) => { passport.authenticate('facebook')

} const fbRedirection = async (req, res) => { passport.authenticate('facebook', {failureRedirect: '/home'}, function (req, res) { // Successful authentication, redirect home. res.redirect('myRoute'); }); }

I installed localhost ssl certificates also and update the website url accordingly

I don`t no where is the mistake. Please if someone can help me to get out of it Thanks