FULL ERROR
Access to fetch at 'http://localhost:5000/login' from origin 'http://localhost:3000' 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
I have this error when I try to make request in reactjs, but I don't have problems with curl for example.
I have also tried with "Access-Control-Allow-Origin: *"
I interpret this as you're running react webserver on port 3000 and a node backend listening on 5000.
you can't make requests cross origin (from the domain localhost:3000 to the domain localhost:5000) because of the cors policy.
The header
Access-Control-Allow-Origin: *should be set by the node backend, but this is a very bad solution. you should add a proxy key to ypur react package json which will proxy all your requests to another server. (see https://create-react-app.dev/docs/proxying-api-requests-in-development/)