moved api interceptor

This commit is contained in:
anovazzi1 2023-08-25 17:21:54 -03:00
commit d2f5a5d564
3 changed files with 2 additions and 2 deletions

View file

@ -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 }) {
<TypesProvider>
<LocationProvider>
<AlertProvider>
<ApiInterceptor />
<SSEProvider>
<TabsProvider>
<UndoRedoProvider>{children}</UndoRedoProvider>

View file

@ -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) {

View file

@ -18,7 +18,6 @@ const root = ReactDOM.createRoot(
root.render(
<ContextWrapper>
<App />
<ApiInterceptor />
</ContextWrapper>
);
reportWebVitals();