Axios shows status code of 0 instead of 403

Viewed 23

I've been trying to capture the response of requests through axios response interceptors.

I have a request that requires authorization; and when the authorization token is valid, the request executes successfully and returns the data with no issues.

However, when the token is expired and the server/backend responds with 403; the Network tab in DevTools shows a 403 and axios shows a 0 status code with CORS issue in the Console.

I know it's not CORS because I have a wildcard allowance on it, the request works fine when the token is valid, and the pre-flight for this returns 200.

Screenshots:

Network Tab

  1. Network Tab
  2. Preflight
  3. Request

Console Tab

  1. Console
  2. enter image description here
0 Answers
Related