require auth

This commit is contained in:
2026-06-19 00:28:23 +05:30
parent 8c824d5239
commit 5892bca44d
3 changed files with 29 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import axios, { AxiosInstance } from "axios";
import { tokenStore } from "../../../react-auth/token";
let apiClient: AxiosInstance | null = null;
@@ -26,7 +27,6 @@ export function initApi(baseUrl: string, getToken?: () => string | null): AxiosI
if (error.response?.status === 401 && getToken) {
const currentToken = getToken();
if (currentToken) {
const tokenStore = { clear: () => localStorage.removeItem("token") };
tokenStore.clear();
}
}