Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirection to facebook #264

Open
Faisalaliarain opened this issue Oct 4, 2019 · 0 comments
Open

Redirection to facebook #264

Faisalaliarain opened this issue Oct 4, 2019 · 0 comments

Comments

@Faisalaliarain
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant