When checking my console, I noticed the following error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'message') at eval. Below is a snippet from my axios.js file:
axiosIns.interceptors.response.use(
response => {
if (response.message === 'Unauthenticated') {
window.location = '/login'
}
return response
},
error => {
if (error.response.message === 'Unauthenticated') {
window.location = '/login'
} else if (error.response.status === 401) {
removeUserData()
return Promise.reject(error)
}
})