I created a very basic app just to try and test out authentication.
I am using flask on the back end, and React on the front end.
When I make the request through the firefox browser, it works (most of the time!). But it does not from chrome.
I get the following message:
Access to fetch at 'http://localhost:5000/api/v1/register' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
If I submit a request via Postman or Curl, it works just fine. So I feel that the backend server code is working fine.
I have tried both including and excluding the headers for 'Access-Control-Allow-Origin' and 'Content-Type'. In all scenarios it doesn't work.
When I googled what to fix, I get a complicated answer like I need to set up a Nginx proxy server.
I am just trying to build apps for my portfolio.
Thank you so much!