Back

Facebook Login problem in appwrite

  • 0
  • Web
abhi4131
18 Jul, 2023, 07:21

When I try to login with facebook in react js using appwrite in that case I will login successfully but I did not render on the home screen.

TL;DR
User is experiencing a Facebook login problem in an app using Appwrite. They tried replacing the scope with openid instead of email and checked the URL, but it didn't solve the problem. They also shared the code for the `handleFacebookLogin` function. The suggestion is to check if there is a misconfiguration between Appwrite and Facebook. No solution has been provided for the problem of not rendering on the home screen after successful login.
Binyamin
18 Jul, 2023, 12:52

Can you share the createOAuth2Session function code?

Drake
19 Jul, 2023, 00:14

What's in the URL? Sometimes there's an error message/description in there

Drake
19 Jul, 2023, 00:15

also, usually, the problem is something is misconfigured between Appwrite and Facebook

abhi4131
19 Jul, 2023, 12:27

const handleFacebookLogin = (e) => { e.preventDefault();

TypeScript
try {
  account.createOAuth2Session(
    "facebook",
    "http://localhost:3000/home",
    "http://localhost:3000/login"
  );
} catch (error) {
  console.log("Facebook Error", error);
}

};

abhi4131
19 Jul, 2023, 12:32

In which URL ? When I click on facebook button it will render on the facebook login then I put the credentials & click on login it says something went wrong I have check the redirect URL & also changing that redirect URL but I have face the same error

Drake
19 Jul, 2023, 14:48

The url of the Facebook page with the error. Maybe the URLs of one of the pages during the redirect might have an error message as well

abhi4131
20 Jul, 2023, 04:44

https://www.facebook.com/v2.8/dialog/oauth?client_id=812104193879303&redirect_uri={OUR_Appwrite_URL}/v1/account/sessions/oauth2/callback/facebook/64a665b80151f63b223b& scope=email&state={"success":"http:localhost:3000home","failure":"http:localhost:3000login"}&ret=login&fbapp_pres=0&logger_id =fe08f713-e343-4bac-88ce-4ca9fb41f422&tp=unspecified&cbt=1689826929333&ext=1689830550&hash=AebV7yKObpzJ0RvsUgE

I have remove the actual domain

Above URL is the when I put the facebook credentials then it render on this URL & also saying something went wrong

Drake
20 Jul, 2023, 05:07

not that helpful 😕

Drake
20 Jul, 2023, 05:10

what about the url of this page?

Drake
20 Jul, 2023, 05:11

could you try to replace the scope with openid instead of email?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more