From 0e693842a6360d92b8886565e6fa011222869d10 Mon Sep 17 00:00:00 2001 From: kurihada Date: Sun, 1 Mar 2026 16:37:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Login=20=E9=A1=B5=E9=9D=A2=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=8A=B6=E6=80=81=EF=BC=88=E9=80=9A=E8=BF=87=E8=BD=BB?= =?UTF-8?q?=E9=87=8F=20cookie-check=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/LoginPage.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/src/pages/LoginPage.tsx b/web/src/pages/LoginPage.tsx index 1ad4a6b..c4c9939 100644 --- a/web/src/pages/LoginPage.tsx +++ b/web/src/pages/LoginPage.tsx @@ -13,6 +13,16 @@ export function LoginPage() { const { status, loading: statusLoading, refresh: refreshStatus } = useLoginStatus(); const { token } = useAuth(); const { toast } = useToast(); + + // Auto-check cookie on mount (lightweight, no browser opened) + useEffect(() => { + if (!token) return; + void checkLoginCookie().then((res) => { + if (res.success && res.data?.hasCookies) { + void refreshStatus(); // Only open browser if cookies exist + } + }).catch(() => {}); + }, [token, refreshStatus]); const navigate = useNavigate(); const [qrData, setQrData] = useState(null);