From d2f5a5d56480373acf0654a5bee15f1461b41902 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 25 Aug 2023 17:21:54 -0300 Subject: [PATCH] moved api interceptor --- src/frontend/src/contexts/index.tsx | 2 ++ src/frontend/src/controllers/API/api.tsx | 1 - src/frontend/src/index.tsx | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/contexts/index.tsx b/src/frontend/src/contexts/index.tsx index acc7f4070..b213ace9d 100644 --- a/src/frontend/src/contexts/index.tsx +++ b/src/frontend/src/contexts/index.tsx @@ -10,6 +10,7 @@ import { TabsProvider } from "./tabsContext"; import { TypesProvider } from "./typesContext"; import { UndoRedoProvider } from "./undoRedoContext"; import { BrowserRouter } from "react-router-dom"; +import { ApiInterceptor } from "../controllers/API/api"; export default function ContextWrapper({ children }: { children: ReactNode }) { //element to wrap all context @@ -23,6 +24,7 @@ export default function ContextWrapper({ children }: { children: ReactNode }) { + {children} diff --git a/src/frontend/src/controllers/API/api.tsx b/src/frontend/src/controllers/API/api.tsx index fc4358ed0..0e74670b0 100644 --- a/src/frontend/src/controllers/API/api.tsx +++ b/src/frontend/src/controllers/API/api.tsx @@ -24,7 +24,6 @@ function ApiInterceptor() { async (error: AxiosError) => { if (error.response?.status === 401) { const refreshToken = cookies.get("refresh_token"); - if (refreshToken) { authenticationErrorCount = authenticationErrorCount + 1; if (authenticationErrorCount > 3) { diff --git a/src/frontend/src/index.tsx b/src/frontend/src/index.tsx index db196080b..3a7cbd9f5 100644 --- a/src/frontend/src/index.tsx +++ b/src/frontend/src/index.tsx @@ -18,7 +18,6 @@ const root = ReactDOM.createRoot( root.render( - ); reportWebVitals();