From fb003504b5c64271b37470b4c53f1c4451acec2a Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Fri, 28 Nov 2025 03:26:56 +0900
Subject: fix(frontend): Fix login processing

---
 frontend/src/contexts/AuthContext.tsx | 5 +++--
 1 file changed, 3 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 36f2b9f..7e38786 100644
--- a/frontend/src/contexts/AuthContext.tsx
+++ b/frontend/src/contexts/AuthContext.tsx
@@ -22,13 +22,13 @@ const urqlContextUser = { additionalTypenames: ["User"] };
 export function AuthProvider({ children }: { children: ReactNode }) {
 	const [, executeLogin] = useMutation(LoginDocument);
 	const [, executeLogout] = useMutation(LogoutDocument);
-	const [currentUserResult] = useQuery({
+	const [currentUserResult, reexecuteGetCurrentUser] = useQuery({
 		query: GetCurrentUserDocument,
 		context: urqlContextUser,
 	});
 
 	const isLoggedIn = !!currentUserResult.data?.currentUser;
-	const isLoading = currentUserResult.fetching;
+	const isLoading = currentUserResult.fetching || currentUserResult.stale;
 
 	const login = async (
 		username: string,
@@ -47,6 +47,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
 			}
 
 			if (result.data?.login?.user) {
+				reexecuteGetCurrentUser({ requestPolicy: "network-only" });
 				return { success: true };
 			}
 
-- 
cgit v1.2.3-70-g09d2

