
Btw, to format multi line code, use 3 back ticks. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting

What exactly is window.location.origin
again?

I am redirecting to adminlogin page after google sign in process. Let's say- I am calling this from localhost. So the redirect url will be -http://localhost/adminlogin?fromRedirectSuccess=true and when I'm trying from https://peapp.elufasys.com, the redirect url will be- https://peapp.elufasys.com/adminlogin?fromRedirectSuccess=true

I wanted to keep it dynamic rather than placing a static url

So did you add that hostname as a web platform to your project? See https://appwrite.io/docs/getting-started-for-web#addPlatform

This is the request I'm sending.

Hostname is the server ip right now

That doesn't sound right...the hostname should be the domain name of your app

The client app or the appwrite production instance?

Client app

Ok, now it is going to google sign in page but giving redirect uri mismatch error. It's saying the redirect uri is-
Request details: redirect_uri=http://appwrite.elufasys.com/v1/account/sessions/oauth2/callback/google/64158b3ada94714c7ab9
But, I have added https redirect uri in the console.

this is probably because of your webserver configuration

I had the same issue where it kept redirecting to http
instead of https

I fixed it by disabling http support completely

Maybe there's a cleaner fix, but this fix is what I did for development.

where are you hosting your appwrite?

Oh Man! I am noob at the server side. Any other options? If not, what should I tell the developer who is maintaining the server?

Here - https://www.vultr.com/

If there's a reverse proxy in front of Appwrite, make sure it's forwarding to Appwrite using https

this

tell this to your developer

Ok, thanks. I will let you know if it's gets fixed.

Looks like you provided success or failure URL (when running createOAuthSession) to a domain that Appwrite does not trust. Can you check what domain you provided there? If you add such a domain as web platform to your project, the problem should be gone.

@Steven , @safwan , it worked. Thanks

[SOLVED] Getting error on Google signin in production
Recommended threads
- I am trying to run appwrite storage list...
Hello! I am trying to use a command to return all of my files from my bucket. This is the cmd I am currently running: "appwrite storage list-files --bucket-id <...
- nextjs site template gets 500 for /v1/pi...
whats the right way to configure this? do i need to deploy a function? im loosing my hair and i can't get a nextjs site to work. pls help
- WebSocket connection failed - Realtime g...
I am using appwrite cloud + angular (appwrite 21.2.1). On Chrome, when I have a realtime subscribtion and I reload the page or navigate to another page, realtim...
