From 79c3528bbcd82c6eed67b17747ded31af09a4a64 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sat, 8 Nov 2025 17:48:54 +0900
Subject: fix(frontend): Fix incorrect caching settings

---
 frontend/src/contexts/AuthContext.tsx | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'frontend/src/contexts/AuthContext.tsx')

diff --git a/frontend/src/contexts/AuthContext.tsx b/frontend/src/contexts/AuthContext.tsx
index 761cc0f..36f2b9f 100644
--- a/frontend/src/contexts/AuthContext.tsx
+++ b/frontend/src/contexts/AuthContext.tsx
@@ -17,11 +17,14 @@ interface AuthContextType {
 
 const AuthContext = createContext<AuthContextType | undefined>(undefined);
 
+const urqlContextUser = { additionalTypenames: ["User"] };
+
 export function AuthProvider({ children }: { children: ReactNode }) {
 	const [, executeLogin] = useMutation(LoginDocument);
 	const [, executeLogout] = useMutation(LogoutDocument);
 	const [currentUserResult] = useQuery({
 		query: GetCurrentUserDocument,
+		context: urqlContextUser,
 	});
 
 	const isLoggedIn = !!currentUserResult.data?.currentUser;
@@ -32,7 +35,10 @@ export function AuthProvider({ children }: { children: ReactNode }) {
 		password: string,
 	): Promise<LoginResult> => {
 		try {
-			const result = await executeLogin({ username, password });
+			const result = await executeLogin(
+				{ username, password },
+				urqlContextUser,
+			);
 
 			if (result.error) {
 				const errorMessage =
@@ -56,7 +62,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
 
 	const logout = async () => {
 		try {
-			await executeLogout({});
+			await executeLogout({}, urqlContextUser);
 		} catch (error) {
 			console.error("Logout failed:", error);
 		}
-- 
cgit v1.2.3-70-g09d2

