From 917988a75c4d21fb74fa9e70a6c51bf68bf65455 Mon Sep 17 00:00:00 2001 From: Glandos Date: Wed, 8 Sep 2021 18:00:02 +0200 Subject: [PATCH] Use synchronous interceptors Since https://github.com/axios/axios/pull/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. --- src/lib/auth-vue-http.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/auth-vue-http.ts b/src/lib/auth-vue-http.ts index e4b7064f..353d5f4d 100644 --- a/src/lib/auth-vue-http.ts +++ b/src/lib/auth-vue-http.ts @@ -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) => { @@ -188,7 +188,7 @@ export default class AuthVueHttp { this.logout(); } return Promise.reject(error); - }); + }, { synchronous: true }); } private startIntervals() {