murraco/spring-boot-jwt

CORS issue reactjs and axios

EzxD opened this issue · 1 comments

EzxD commented

hello i get this error when performing a request from axios:

Access to XMLHttpRequest at 'http://localhost:8080/users/signin?username=admin&password=admin' 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.

@EzxD I had the same problem and added "http.cors();" to the WebSecurityConfig hope this helps u out.