Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

find 401 error and logout axios in react

axios.interceptors.response.use(response => {
   return response;
}, error => {
  if (error.response.status === 401) {
   //place your reentry code
  }
  return error;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #error #logout #axios #react
ADD COMMENT
Topic
Name
7+4 =