This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const interceptor = (store) => { | |
axios.interceptors.response.use(response => { | |
console.log(`request to ${response.config.url} OK with ${response.status}`) | |
return Promise.resolve(response) | |
}, (error) => { | |
console.log(`request to ${error.response.config.url} failed with ${error.response.status}`) | |
if (error.response.status == 401) { | |
const failedRequestConfig = error.config |