CORS ERROR when setup Omada controller wit external portal
Hello Community,
I successfully integrated my access point with my remote controller, but I’m encountering an issue with the CORS policy.
My external portal is deployed on rayen.github.io, and my controller is hosted on omada-dev.xxxxx.io. When I send a POST request to authenticate the operator, I receive a CORS error.
Could you please guide me on how to resolve this issue?
Here’s the code for the request:
async function loginOperator(username, password) { const url = 'https://omada-dev.xxxxx.io:8043/fsdfdsfdsffdsfdsfdsfsdfds/api/v2/hotspot/login'; const options = { method: 'POST', headers: { 'content-type': 'application/json', 'Accept': 'application/json', 'Access-Control-Allow-Origin': 'https://rayen.github.io', }, body: '{"name":"name","password":"password"}' }; try { const response = await fetch(url, options); const data = await response.json(); alert(data); } catch (error) { alert(error); } }
