diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-07-13 03:02:02 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-07-13 03:02:02 +0530 |
commit | 0d147359d877e244ae6e8fa4f50097b72948c1aa (patch) | |
tree | 0ec0f91fe12a37ccd614c1fda9dc4baf286bb92f | |
parent | 0ab42c437c2fa40e9f9483791ad8971eefb41ed1 (diff) |
not retrying API call if token refresh results in 401
-rw-r--r-- | src/main.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.ts b/src/main.ts index c3b6952..56ab8a3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,12 +1,11 @@ -import './assets/main.scss' - import { createApp } from 'vue' import App from './App.vue' import router from './router' import axios from 'axios' -import * as bootstrap from 'bootstrap' import 'vue-toast-notification/dist/theme-sugar.css' +import './assets/main.scss' + axios.defaults.baseURL = '/api' axios.defaults.headers.post['Content-Type'] = 'application/json' @@ -31,7 +30,7 @@ axios.interceptors.response.use( async (err) => { const originalConfig = err.config - if (originalConfig.url !== '/auth/signin' && err.response) { + if ((originalConfig.url !== '/auth/signin' && originalConfig.url !== "/auth/refresh" ) && err.response) { if (err.response.status === 401 && !originalConfig._retry) { originalConfig._retry = true |