aboutsummaryrefslogtreecommitdiff
path: root/src/main.ts
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2024-07-13 03:02:02 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2024-07-13 03:02:02 +0530
commit0d147359d877e244ae6e8fa4f50097b72948c1aa (patch)
tree0ec0f91fe12a37ccd614c1fda9dc4baf286bb92f /src/main.ts
parent0ab42c437c2fa40e9f9483791ad8971eefb41ed1 (diff)
not retrying API call if token refresh results in 401
Diffstat (limited to 'src/main.ts')
-rw-r--r--src/main.ts7
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