mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-24 22:12:06 +02:00
Cancel promise in axios interceptor to ensure redirection
This commit is contained in:
parent
f2dbf3f1e2
commit
52ac639940
5
resources/js/api.js
vendored
5
resources/js/api.js
vendored
@ -43,10 +43,13 @@ Vue.axios.interceptors.response.use(response => response, error => {
|
|||||||
|
|
||||||
// Otherwise we push to the error views
|
// Otherwise we push to the error views
|
||||||
if ( error.response.status === 404 ) {
|
if ( error.response.status === 404 ) {
|
||||||
router.push({name: '404', params: { err : error.response }})
|
|
||||||
|
router.push({name: '404'})
|
||||||
|
throw new Vue.axios.Cancel('pushed to 404');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
router.push({ name: 'genericError', params: { err: error.response } })
|
router.push({ name: 'genericError', params: { err: error.response } })
|
||||||
|
throw new Vue.axios.Cancel('pushed to generic error');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user