
Hi, I implemented Appwrite Google Authentication in NextJS v14.1.3 and successfully implemented the sign in feature (on SSR) when trying it in localhost, but when deploy to Vercel, I see the console showing this error and not let me sign in, is there any special thing I should do before deploying to Vercel?
I followed SSR tutorial from Appwrite (https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-7)
Thank you very much for your help !

That looks like an error generated by Vercel, I'm not too familiar with hosting on Vercel, but are there any logs that you're able to access that could show the proper error?

Hi Ryan, thank you for replying me!
I just checked again the server log, there is this log
TypeError: Invalid URL at new URL (node:internal/url:797:36) at l.call (/var/task/.next/server/app/signin/page.js:3:105095) at s.createOAuth2Token (/var/task/.next/server/app/signin/page.js:3:125188) at s (/var/task/.next/server/app/signin/page.js:1:13347) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'ERR_INVALID_URL', input: 'undefined/account/tokens/oauth2/google' }
I wonder, do I need to change the const origin = headers().get("origin");
to be my vercel domain?

Changing it to the Vercel domain would definitely work, not sure if this is also worth a look as it lists the headers that are included in deployments https://vercel.com/docs/edge-network/headers#host

Hi Ryan, sorry, previous error is because I didn't push .env file to production 😩 . Once I push the .env file, I got another issue which is "Invalid success
param: URL host must be one of: localhost, cloud.appwrite.io, appwrite.io"
I got this when either using
const origin = headers().get("origin")
or
const origin = "https://<domain>.vercel.app"

I have tried with this solution : https://discord.com/channels/564160730845151244/1236413621660291193
but the domain verification is failed. Do I need to wait for 48 hours?

Domain verification can take some time simply due to how long DNS changes can take. I'd say give it about 48 hours just to make sure and then check back in on the domain verification

Did I do it correctly?

I need to fix this too pls

what was the fix? @Ryan @richardoey
Recommended threads
- Unable to create push providers - FCM or...
Currently unable to create a push provider for FCM or APNS.... https://github.com/appwrite/console/issues/2045 When uploading a file... FCM = Valid file retu...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
