mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-02-16 18:31:49 +01: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
|
||||
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 {
|
||||
router.push({ name: 'genericError', params: { err: error.response } })
|
||||
throw new Vue.axios.Cancel('pushed to generic error');
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user