Answer the question
In order to leave comments, you need to log in
Strange operation of CORS policy. What could be wrong?
This is not a typical CORS question
. Hello!
In general, the following problem: when sending a request from the front to api (mine, all the necessary headers are set) with the correct data, no errors occur.
axios.post('http://localhost:8080/auth/login', {
email: "[email protected]",
password: "123456"
})
axios.post('http://localhost:8080/auth/login', {
email: "[email protected]",
password: "not correct password"
})
Access to XMLHttpRequest at 'http://localhost:8080/auth/login' from origin 'http://test' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Access-Control-Allow-Origin: http://test
Access-Control-Allow-Methods: *
Access-Control-Allow-Headers: *
Access-Control-Allow-Credentials: true
// Status: 200
Answer the question
In order to leave comments, you need to log in
Obviously, with a 401 error, the Access-Control-Allow-Origin header does not arrive from the back (from the api).
And since only attempts at the front are painted, and about the back only allegedly "all the necessary headers are set", then there is no answer here.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question