Answer the question
In order to leave comments, you need to log in
How to use axios.interceptors.response to catch a 403 error and show a modal with a warning?
How can I make it show a modal with a warning on a 403 error?
I use
axios.interceptors.response.use((response) => {
return response
}, (error) => {
if (error.response.status == 401) {
localStorage.removeItem('token')
router.push({ path: '/login' })
}
return Promise.reject(error)
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question