Hey, I have a staging environment in my Ory Networ...
# ory-network
c
Hey, I have a staging environment in my Ory Network Production plan account that I am trying to assign a custom domain to. I have added the custom domain, but when I try to setup CORS I am getting an error in the UI when trying to save. The error I am getting says:
Copy code
cors_allowed_origins must be a `array` type, but the final value was: `null`. If "null" is intended as an empty value be sure to mark the schema as `.nullable()`
This error happens even if I try changing the CORS origin field to be an array, such as
["http://localhost:80/"]
. What is the right way to add a single CORS origin for the custom domain feature?
m
Why do you want to add localhost as CORS origin in the first place? If you want to access the Ory APIs locally use Ory Tunnel. I think adding localhost here is blocked (the error message could probably be improved) otherwise you also need to omit the final / - so
https://example.com
works, but
https://example.com/
doesn't.
s
c
Thanks @steep-lamp-91158 and @magnificent-energy-493. I think this was some combination of both of these issues. Inputting anything with
localhost
appears to be treated as invalid, and writing several comma/space separated domains also doesn't work without first de-focusing the field. Hence, every combination I was inputting (that included
localhost
kept triggering the error). I definitely think this input could be more intuitive, especially for multiple origin input. I also think the error message for
localhost
should specifically mention this is not accepted here.