require auth
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user