Back

Error creating a membership using appwrite teams api

  • 0
  • Teams
  • Web
  • Self Hosted
anyuru
6 Sep, 2023, 12:36

When creating a membership with appwrite teams API, it returns an error as in the screenshot provided. I earlier tried with this it worked on local host. But it doesn't on vercel. Even after updating my redirect url to the vercel endpoint thing doesn't work. How can I solve this error. Attached are screenshots of my error and function. What is the purpose of the callback url anyway if it when I put my vercel endpoint it just throws an error.

TL;DR
User encountered an error creating a membership using Appwrite Teams API. The error message states that the URL host must be one of: localhost, aw.ablestate.cloud, *.vercel.app. User is unsure how to get a valid path and port for the host name. User asks if they should specify the host name explicitly and doesn't understand why it fails. The solution provided is to add the Vercel domain to the Platforms in the Appwrite project. The purpose of the callback URL is also questioned. Screenshots of the error and function are attached.
ideclon
6 Sep, 2023, 12:51

You need to add your Vercel domain to Platforms in your Appwrite project

anyuru
6 Sep, 2023, 12:54

It has *.vercel.app and to my understanding the asterisks means all

anyuru
6 Sep, 2023, 12:55

So I don't understand why it would fail

anyuru
6 Sep, 2023, 12:55

Should I specify it explicitly

anyuru
6 Sep, 2023, 12:55

?

ideclon
6 Sep, 2023, 12:58

My understanding is that CORS doesn’t support subdomain wildcards

anyuru
6 Sep, 2023, 13:03

It says that the host name should have a valid path and port. I don't know how to get those

anyuru
6 Sep, 2023, 13:03

It says that the host name should have a valid path and port. I don't know how to get those

anyuru
6 Sep, 2023, 13:14

It returns this error Customer Membership 2: AppwriteException [Error]: Invalid url: URL host must be one of: localhost, aw.ablestate.cloud, *.vercel.app at Client.call (/Users/davie/Documents/workspace/autofore/backend/node_modules/node-appwrite/lib/client.js:174:31) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Teams.createMembership (/Users/davie/Documents/workspace/autofore/backend/node_modules/node-appwrite/lib/services/teams.js:271:16) at async createUser (/Users/davie/Documents/workspace/autofore/backend/src/handlers/createUser.js:25:36) { code: 400, type: 'general_argument_invalid', response: { message: 'Invalid url: URL host must be one of: localhost, aw.ablestate.cloud, *.vercel.app', code: 400, type: 'general_argument_invalid', version: '1.3.7' } }

ideclon
6 Sep, 2023, 13:20

The redirect path has to be one of the platforms you’ve added.

anyuru
6 Sep, 2023, 13:23

Thanks. I think doing away with the wild card solved it

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more