Authenticating With Facebook using Passport Not Working
The problem was I didn't attach the domain name (in my case it is http://localhost:8080
) in Facebook app settings.
Go to the Settings page under the Basic tab
- Click "+ Add Platform" and choose "Website"
- In the box that comes up for the website you just added: Site URL:
http://localhost:8080/
- In the box above that (Settings => Basic): App Domain: localhost
- At the bottom right - click "Save Changes"
Once I done that my problem get solved.
app.get('/auth/facebook', passport.authenticate('facebook', { scope : 'email' }));
Also, the above should be changed to:
app.get('/auth/facebook', passport.authenticate('facebook', { scope : ['email'] }));