jaredhanson / passport-facebook

Facebook authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-facebook/?utm_source=github&utm_medium=referral&utm_campaign=passport-facebook&utm_content=about
MIT License
1.3k stars 445 forks source link

Passport Facebook not redirecting correctly (Error Code 500) #282

Open Terribleangel opened 3 years ago

Terribleangel commented 3 years ago

Hello, Passport facebook has started throwing a really funky error on redirect. I thought it was something to do with the versioning of the graph api but as shown from the url, I've run it with api v10.0 and the error is still persisting. image

Does anyone know why this is happening? This is incredibly frustrating for me

babu0008 commented 3 years ago

Hello, Passport facebook has started throwing a really funky error on redirect. I thought it was something to do with the versioning of the graph api but as shown from the url, I've run it with api v10.0 and the error is still persisting. image

Does anyone know why this is happening? This is incredibly frustrating for me

in the authentication, write this code only

app.get("/auth/facebook",
  passport.authenticate('facebook'));

Not something like this. by default profile will be displayed.

app.get("/auth/facebook",
  passport.authenticate('facebook', {scope: ["profile"] }));

but if you need additional scope. for example email, you can write like this.

app.get("/auth/facebook", passport.authenticate('facebook', {scope: ["email"] }));

if you still have the same problem. pls let me know.

asynctushar commented 1 year ago

app.get("/auth/facebook", passport.authenticate('facebook', {scope: ["email"] }));

and what if I don't give access to my email from facebook? still got listed on facebook app list.