fix: little fixes

This commit is contained in:
2026-08-13 23:02:25 +03:00
parent 9156f29707
commit 2e32d226d3
5 changed files with 496 additions and 2 deletions
+15 -1
View File
@@ -1,6 +1,6 @@
import { useQueryClient } from "@tanstack/react-query";
import { createContext, useContext, useEffect, useRef, useState } from "react";
import { apiClient } from "../../../shared/api";
import { apiClient, configureAuthClient } from "../../../shared/api";
import type { paths } from "../../../shared/api/generated/schema";
type User =
@@ -97,6 +97,20 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
}
}
useEffect(() => {
configureAuthClient({
accessToken: () => accessTokenRef.current,
refresh,
clear: () => {
setUser(null);
setAccessToken(null);
accessTokenRef.current = null;
queryClient.clear();
},
});
return () => configureAuthClient(null);
});
return (
<AuthContext
value={{