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.ukand 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.ukto 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
- rxdb integration code not working
https://appwrite.io/blog/post/offline-first-journal This code does not work with rxdb and appwrite packages set to february releases nor newest releases
- Costom domain Issues
Hi Appwrite team Weβre having issues verifying a custom domain. We added the required CNAME and CAA records to our DNS provider and waited for at least 2 days a...
- No domain visible after creating functio...
Saw this in docs yet i have no domain (Pro): ``` Generated domains In the Appwrite Console's sidebar, click Functions. Under the Domains tab, you'll find the g...