remove cookies, when refresh tokken is not correct

This commit is contained in:
jonathan 2021-03-31 15:33:06 +02:00
parent a6bbc79721
commit 347b6654ef

View File

@ -35,6 +35,14 @@ export default function ({ $axios, store, redirect, route }) {
return $axios(originalRequest)
}
})
.catch((error) => {
if (error.response.status === 401) {
store.commit('auth/REMOVE_TOKEN')
store.commit('auth/UPDATE_IS_LOGIN', false)
redirect('/')
return Promise.reject(error)
}
})
}
return Promise.reject(error)
})