Failed to load http://localhost:3030/api/auth/login: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:3000’ is therefore not allowed access.
I’m using the Cors middleware defined in the Slim docs. I don’t get any of the headers back that are set on the response.
Using Nuxt/Axios on client.
$response ->withHeader('Access-Control-Allow-Origin', 'http://localhost:3000, http://localhost:3030') ->withHeader('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, Accept, Origin, Authorization, Access, Host') ->withHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, PATCH, OPTIONS');
Also worth noting, works fine with Postman.
I saw some similar posts but never really saw an actual solution.