Skip to content

Commit

Permalink
Use synchronous interceptors
Browse files Browse the repository at this point in the history
Since axios/axios#2702 (in axios 0.21.2) it is possible to avoid delay in requests.
Interceptors set up by vue-auth are global, and are delaying every other callers.
  • Loading branch information
Glandos committed Sep 8, 2021
1 parent 10ac8e7 commit 917988a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/auth-vue-http.ts
Expand Up @@ -179,7 +179,7 @@ export default class AuthVueHttp {
return request;
}, (error: any) => {
return Promise.reject(error);
});
}, { synchronous: true });
this.http.interceptors.response.use((response: AxiosResponse) => {
return response;
}, (error: any) => {
Expand All @@ -188,7 +188,7 @@ export default class AuthVueHttp {
this.logout();
}
return Promise.reject(error);
});
}, { synchronous: true });
}

private startIntervals() {
Expand Down

0 comments on commit 917988a

Please sign in to comment.