
So, google authentication works in localhost, but not in the deployment.
code:
async createAuthSession(provider) {
const currentDomain = process.env.NEXT_PUBLIC_WEBSITE_URL;
this.account.createOAuth2Session(provider, `${currentDomain}/profile`, `${currentDomain}/auth`);
}
environment variable: NEXT_PUBLIC_WEBSITE_URL=(website name)
in google cloud console: Authorised Javascript Origins:
- (website name)
- http://localhost:3000
Authorized redirect URIs (I'm aware that we don't need to add so many URIs)
- http://localhost:3000/auth
- https://tasknexus.vercel.app/auth
- http://localhost:3000/profile
- https://tasknexus.vercel.app/profile
- (appwrite uri from Google OAuth2 Settings)
error i receive is mentioned in the image as well, but adding it here too:
Error 400 Invalid
success
param: URL host must be one of: localhost, cloud.appwrite.io, *Type
general_argument_invalid
it works splendidly in localhost, but not in deployment!

Try adding a hostname in the web app settings

I've used * here. It should work logically. But I'll try adding the name of the website

Hey man. Thank you for replying first of all. And yeah, it works now. Both in development and production mode

It doesn’t seem to work for the OAuth response URLs
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...
