Great Article! I am having an issue with CORs. Everything works great locally but when I upload my backend to api.example.com and my frontend to example.com I get this issue.
Access to XMLHttpRequest at 'api.example.com/api/banlist/fetch' from origin 'example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
It is set but still same error. Could it be because the API and frontend are in different directories? I have tried just about everything and I am still getting the same error. I am almost to the point of moving the frontend into Laravel.
Great Article! I am having an issue with CORs. Everything works great locally but when I upload my backend to api.example.com and my frontend to example.com I get this issue.
Access to XMLHttpRequest at 'api.example.com/api/banlist/fetch' from origin 'example.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Have you tried to add SANCTUM_STATEFUL_DOMAINS=127.0.0.1 to .env file on the server?
Yes this is set in the .env file.
It is set but still same error. Could it be because the API and frontend are in different directories? I have tried just about everything and I am still getting the same error. I am almost to the point of moving the frontend into Laravel.
Have you set baseURL and headers in main.js?
Just tried this and same error.
Could you share your repositories? I could have a look tomorrow. My email address is roman@paprotsky.com
Cool thank you. I sent you an email.
Thank you!
Hi @derek how was this problem solved?
hi, did you manage to solve the problem?