Back

Please help on the authentication setup for a vercel deployment in vite react

  • 0
  • Auth
  • Web
newsoup
2 May, 2024, 14:37

hi im using appwrite for vite in react for authenticating google signin a little help would be great- im using env files in my project to store the apprite project credentials also for the login im using this - const signInWithGoogle = async () => { try { const response = await account.createOAuth2Session( "google", "http://localhost:5173/home", "http://localhost:5173/login" ); cons; console.log(response); } catch (error) { console.log(error); } };

and register functions im using - the same as above while clicking on the google link im registering also in the google console im using the same exact steps as dennis ivy mentioned in the google auth setup video

the problem now is when im deploying my project in vercel im giving these- for the authorized js URI - i have given the vercel deployment link also the redirect URI is from the appwrite google auth setting

for the oauth consent screen the app domain is same as vercel deployment link and in the authorized domain i have the vercel deployment link without https:// and appwrite.io as well

test user email is also given but when i sign in in the deployment link i get this error

404: NOT_FOUND Code: NOT_FOUND ID: bom1::fpvlc-1714659501818-4fc65bad1caa

TL;DR
Developers looking to set up authentication with a Vercel deployment in Vite React using Appwrite encounter a 404 error during sign-in. The issue might be with the OAuth setup in the Google console for Vercel deployment. Ensure the URIs and domains are correct, with https:// for authorized domains. Check to see if the redirect URI matches the Appwrite Google auth settings. Make necessary adjustments to resolve the error.
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