
I get the error with NextJS and GitHub OAuth, i found this and tried to use it to solve by moving from locahost
to using sub domains https://github.com/appwrite/appwrite/issues/1203#issuecomment-850787160
{"message":"Invalid `success` param: URL host must be one of: localhost, appwrite.jaoudestudios.co.uk, *.vercel.app,localhost,rating.jaoudestudios.co.uk","code":400,"type":"general_argument_invalid","version":"0.11.33"}
After research, I have done the following, am I missing something?
- used a custom sub domain
appwrite.jaoudestudios.co.uk
and added it to my Appwrite Cloud project - using custom sub domain to connect to Appwrite
const client = new Client()
.setEndpoint("https://appwrite.jaoudestudios.co.uk/v1")
.setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID);
- using a host file for
rating.jaoudestudios.co.uk
to point tolocalhost
, and added to allowed hostnames
const login = async () => {
account.createOAuth2Session(
"github",
"http://rating.jaoudestudios.co.uk:3000/account",
"http://rating.jaoudestudios.co.uk:3000/failed"
);
};
- github oauth settings is
https://appwrite.jaoudestudios.co.uk/v1/account/sessions/oauth2/callback/github/XXX

For the hostname, can you try creating separate web platforms for each?

I only created the sub domains because of the GitHub Discussion with cross domain limitations on OAuth, I am happy to use localhost

In order for the cookies to work as 1st party, the Appwrite endpoint needs to be a subdomain for your app. So if your app is on rating.jaoudestudios.co.uk, the Appwrite endpoint would need to be on something like appwrite.rating.jaoudestudios.co.uk

oh really? not what I understand from the github discussion but I can try still that

You can try...

I will try now š

But you'll need separate web platforms. Comma separated values here won't work

ok, so I will need one for each sub domain?

it seems to work, but I made 2 changes, I think the fix was removing the comma separate domains and leaving only 1

thank you for your help Steven!

Fyi, I'm pretty sure we have a PR pending merge/release to return an error if you pass in invalid hostname

it has multiple domains in there already to begin with, so I just appended an additional domain - that would be great, it would have saved me most of the day

Hmm I'm not sure how/why it had multiple š§

[SOLVED] github oauth error "general_argument_invalid"

github oauth error "general_argument_invalid"

@Eddie Jaoude | EddieHub Sorry, I closed the wrong post š«£

I thought this was the old one

My apologies š

no worries š

Anyways, did you have solved it?

yes it is now solved š

Okay, so seems I could mark it anyways š

Glad to hear

[SOLVED] github oauth error "general_argument_invalid"
Recommended threads
- phantom relationships appear on parent c...
i have this bug were my past deleted collection apears as relationship to my parent collection. when i try to delete that relationship from parent it gives me e...
- Attribute stuck on proccessing
i tried creating a new attribute butits stuck on proccessing,i did a hard refresh,cleared cache everything but still stuck on proccessing,also in my functions w...
- Appwrite Cloud Custom Domains Issue
Iām trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
