title: Axios Interceptor not intercepting error statuses when API called is made
body: <p>I am trying to intercept all the 401 responses and then redirecting them to another page.</p>
  
  <p>This is what I have done for the instance</p>
  
  <pre><code>const instance = axios.create({
    baseURL: "https://api.example.com/",
    withCredentials: true
  });
  
  // Add a response interceptor
  instance.interceptors.response.use(
    function(response) {
      return response;
    },
    function(error) {
      if (401 === error.response.status) {
          console.log('intercepted');
          window.location = "/login";
      } else {
        return Promise.reject(error);
      }
    }
  );
  
  export default instance;
  </code></pre>
  
  <p>And in my API services file, I am calling axios using the instance. </p>
  
  <pre><code>import axiosInstance from "../utils/axiosInstance";
  const response = await axiosInstance.post("/player/new", bodyFormData);
  </code></pre>
  
  <p>This API will return 401 however the interceptor isn't catching it and I can see the failed request in the network dev tools.</p>