Hi guys,
When I want to create an email verification with the createVerification endpoint, I'm getting this error:
stack: 'AppwriteException: Invalid url
param: URL host mβ¦//exampledomain.com/assets/index-89d49a4b.js:132:100454)'}
Im using a react app that I created with vite and deployed on vercel. All the other endpoints work. Its just the verification.
Im also using the appwrite cloud. No selfhosting.
Thats the payload that is beeing send: {url: "https://exampledomain.com/verification-completed"}
Does anyone have experience with that kind of behaviour?
Here is the full error message that I get back:
{
"name": "AppwriteException",
"message": "Invalid url
param: URL host must be one of: localhost, cloud.appwrite.io, *, *exampledomain.com, exampledomain.com, www.exampledomain.com",
"stack": "AppwriteException: Invalid url
param: URL host must be one of: localhost, cloud.appwrite.io, *, *exampledomain.com, exampledomain.com, www.exampledomain.com\n at Y8.<anonymous> (https://exampledomain.com/assets/index-89d49a4b.js:132:106658)\n at Generator.next (<anonymous>)\n at a (https://exampledomain.com/assets/index-89d49a4b.js:132:100454)"
}
Appreciate the help!
as it says...what you're passing for hte url is invalid
what's your code?
My code is: const client = new Client(); client.setEndpoint(appwriteEnv.endpoint!).setProject(appwriteEnv.project!);
const account = new Account(client); createVerification: (url: string) => { return account.createVerification(url); },
url (for the callback) is: https://exampledomain.com/verification-completed
It works on localhost. Just doesn't work in production on vercel. I think it could be because of the build of vite in combination with react. But I dont know if thats the right track. Any experience with that?
I tried to also build it with webpack. Also when Im using the serve of the builded project, it gives me the same error. So it just does not work in general when I access the builded project. Only works when I start the project in dev mode with for exmaple "yarn start"
are you able to share the network logs from the browser?
what exactly did you put for your web platforms?
As my Platform I have a Web Platform: *exampledomain.com, exampledomain.com, www.exampledomain.com"
I also noticed that once I change the callback url to localhost:port/verification-completed, it works when I build and serve the project. So there has to be something with the domain in combination with the built project.
uhhh that's 1 platform? you can't have multiple values
Yeah I've noticed π My bad! As the hostname I've put "*exampledomain.com". But that is what I get when I call createVerification on the built deployed react app:
"{
"name": "AppwriteException",
"message": "Invalid url
param: URL host must be one of: localhost, cloud.appwrite.io, *exampledomain.com",
"stack": "AppwriteException: Invalid url
param: URL host must be one of: localhost, cloud.appwrite.io, *exampledomain.com\n at e.<anonymous> (https://exampledomain.com/static/js/main.3a597d5b.js:2:696578)\n at p (https://exampledomain.com/static/js/main.3a597d5b.js:2:678641)\n at Generator.<anonymous> (https://exampledomain.com/static/js/main.3a597d5b.js:2:679993)\n at Generator.next (https://exampledomain.com/static/js/main.3a597d5b.js:2:679070)\n at a (https://exampledomain.com/static/js/main.3a597d5b.js:2:688163)"
}"
In the network tab under "payload" of the request the payload looks like that: url: https://exampledomain.com/verification-completed
Any idea what could cause that? As I said, everything else works. Login, making requests to different "storage endpoints" and so on.
can you DM me exactly what your code, payload and what the web platform is?
Recommended threads
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here π I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...