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);