React Router + Axios interceptors. How to Do a redirect?
问题 I have an axios interceptors and when a user gets forced logged out(because of expired token) I want to go back to my home page. I am not sure how to pass react router to it though. I am using mobx but not sure if that will help me with this problem. export const axiosInstance = axios.create({ baseURL: 'https://localhost:44391/api', timeout: 5000, contentType: "application/json", Authorization: getAuthToken() }) axiosInstance.interceptors.response.use(function (response) { return response; },