0

I want to get a refersh token when api response is 401. But when I log the error.status it undefiend or not exist!!

Bellow is my code :

Axios.interceptors.response.use((res) => res,
    async (error) => {
      console.log(error);
})

What is aproblem? How Can I fix it?

  • 1
    Does this answer your question? [axios interceptors response undefined](https://stackoverflow.com/questions/49886315/axios-interceptors-response-undefined) – Emile Bergeron Dec 03 '22 at 21:56

1 Answers1

0

Try to grab the status from error.response.status.

tyukesz
  • 31
  • 1
  • 3