-
-
Notifications
You must be signed in to change notification settings - Fork 445
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
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: