6. Error / / 2024. 5. 30. 16:08

[CORS] The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.



에러 내용

Access to XMLHttpRequest at 'https://api.app.com/scm/v1/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

 

해결

백엔드에서 설정을 안함

withCredentials 을 프론트에서 설정할 경우, 백에서도 추가설정이 필요함

728x90
  • 네이버 블로그 공유
  • 네이버 밴드 공유
  • 페이스북 공유
  • 카카오스토리 공유