diff --git a/app/[locale]/join/page.tsx b/app/[locale]/join/page.tsx index 6c57a3a..91b77b0 100644 --- a/app/[locale]/join/page.tsx +++ b/app/[locale]/join/page.tsx @@ -63,7 +63,7 @@ export default function JoinPage() { const checkAuth = useCallback(async () => { if (getStoredToken()) return true; try { - const res = await fetch("/api/auth/me"); + const res = await fetch("/api/auth/me", { credentials: "include" }); const data = await res.json(); return !!(data?.user && data?.token); } catch { diff --git a/app/components/AuthModal.tsx b/app/components/AuthModal.tsx index 2d7540c..539c353 100644 --- a/app/components/AuthModal.tsx +++ b/app/components/AuthModal.tsx @@ -49,6 +49,7 @@ export default function AuthModal({ isOpen, onClose, onSuccess }: AuthModalProps method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ token: result.token, record: result.record }), + credentials: "include", }); } catch { /* ignore */ diff --git a/app/components/Header.tsx b/app/components/Header.tsx index 53eb633..63e0c19 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -28,7 +28,7 @@ export default function Header() { let mounted = true; (async () => { try { - const res = await fetch("/api/auth/me"); + const res = await fetch("/api/auth/me", { credentials: "include" }); const data = await res.json(); if (!mounted) return; if (data?.user && data?.token) {