I'm trying to implement facebook login with vue-authenticate and passport. I succeeded in logging into my Facebook account. And i got the 'Callback code' successfully. This is my callback url
So I used axios to pass the 'Callback code' to the server. because my server code(passport-facebook) is this:
router.route('/auth/facebook/callback').get(passport.authenticate('facebook', {
successRedirect : '/',
failureRedirect : '/'
}));
and axois code in Vue is
this.$http.get('/api/users/auth/facebook/callback',{
params:{
code : this.param
}
})
.then((response) => {
this.movies = param;
})
but it never works.. I don't know why. just wondering, i chaneged axios code to get('api/users/')
. and wrote server code like this
router.get('/',()=>{
console.log("good");
});
it works. I can see the 'good' message in console. Let me know how you implement social sign-in!
if you want to configure Facebook login with passport So you can simply follow these Steps As mention below:
Step 1. Add passport configuration
Step 2. Setup facebook configuration
This will fix your issue
Please refer this link https://www.sitepoint.com/passport-authentication-for-nodejs-applications/