Back

Google OAuth isn't working.

  • 0
  • Auth
  • Web
droovian
16 Oct, 2024, 14:10

I've tried many things: referred blogs,videos but it still doesnt work properly.

Here's the login function i'm using within my appwrite.ts file: export const loginWithGoogle = async () => { try { await account.createOAuth2Session( OAuthProvider.Google, 'http://localhost:3000/home', 'http://localhost:3000/fail' )

TypeScript
} catch (error) {
  console.error('OAuth login error:', error);
}

}

It suddenly worked and an entry was made into the "Auth" in my appwrite dashboard but I couldnt access any session params. I've attached an image of the error as well as my Google cloud console page. Just to clarify, as I press a button it does show me the google OAuth popup but after I select an account it throws the above error. ( Using Next 14 app router, appwrite v16.0.2)

TL;DR
Problem with Google OAuth in app development. The login function is creating an entry in Appwrite dashboard but not able to access session params. Error pops up after selecting account in Google OAuth popup. Developers have tried various solutions but still facing issues. Solution may require checking Google Cloud Console settings and ensuring correct routes are used for OAuth.
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