
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
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- Sites 30MB limit from GitHub
I’m deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but it’s in a subdirectory with the root being an html landin...
- [bug] API response is good but UI don't ...
Hi guys! When i got my object, it have billingInfo relation, in the web ui i just got pading state, and the row shows object is null, but when i work whit this...
