I am using firebase hosting to host my dynamic website. I used facebook-passport to authenticate via Facebook however the FacebookStrategy callback error:
Error:
{
"name":"InternalOAuthError",
"message":"Failed to obtain access token",
"oauthError":{
"errno":"EAI_AGAIN",
"code":"EAI_AGAIN",
"syscall":"getaddrinfo",
"hostname":"graph.facebook.com",
"host":"graph.facebook.com",
"port":443
}
}
MY ROUTE:
app.get('/sign-in/facebook', passport.authenticate('facebook', { scope:['email'] }));
app.get('/sign-in/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/sign-in', failureFlash: true }),
(req, res) => {
res.redirect('../../user/account');
},
err,req,res,next)=>{
res.send(err);
res.end();
}
);
MY PASSPORT:
passport.use(new FacebookStrategy({
clientID: config.FACEBOOK.clientID,
clientSecret: config.FACEBOOK.clientSecret,
callbackURL: config.host_name+"/sign-in/facebook/callback", //config.host_name+
profileFields: ['id', 'displayName', 'picture.type(large)', 'emails'],
enableProof: true,
},
function(accessToken, refreshToken, profile, done) {
process.nextTick(function () {
AuthorService.loginWithGoogleSrv(profile, (err, user)=>{
return done(err, user);
})
});
}
));
What could be the issue here. App is live. Thank you!