From 0d147359d877e244ae6e8fa4f50097b72948c1aa Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sat, 13 Jul 2024 03:02:02 +0530 Subject: not retrying API call if token refresh results in 401 --- src/main.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') 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 -- cgit v1.2.3