From d4b32794dc4b5521bf8ebbff0bc753f4a07f2a98 Mon Sep 17 00:00:00 2001 From: AutonetSellCar Deploy Date: Sat, 10 Jan 2026 01:36:14 +0900 Subject: [PATCH] fix: Replace isLoggedIn with token/user check in board pages Co-Authored-By: Claude Opus 4.5 --- frontend/src/app/board/[id]/page.tsx | 3 ++- frontend/src/app/board/edit/[id]/page.tsx | 3 ++- frontend/src/app/board/page.tsx | 3 ++- frontend/src/app/board/write/page.tsx | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/board/[id]/page.tsx b/frontend/src/app/board/[id]/page.tsx index f62f43c..6043cb3 100644 --- a/frontend/src/app/board/[id]/page.tsx +++ b/frontend/src/app/board/[id]/page.tsx @@ -11,7 +11,8 @@ export default function BoardPostPage() { const router = useRouter(); const params = useParams(); const postId = parseInt(params.id as string); - const { user, isLoggedIn } = useAuthStore(); + const { user, token } = useAuthStore(); + const isLoggedIn = !!token && !!user; const { translate, language } = useTranslate(); const [post, setPost] = useState(null); diff --git a/frontend/src/app/board/edit/[id]/page.tsx b/frontend/src/app/board/edit/[id]/page.tsx index af4222d..fbcb0e8 100644 --- a/frontend/src/app/board/edit/[id]/page.tsx +++ b/frontend/src/app/board/edit/[id]/page.tsx @@ -11,7 +11,8 @@ export default function BoardEditPage() { const router = useRouter(); const params = useParams(); const postId = parseInt(params.id as string); - const { user, isLoggedIn } = useAuthStore(); + const { user, token } = useAuthStore(); + const isLoggedIn = !!token && !!user; const { translate, language } = useTranslate(); const [post, setPost] = useState(null); diff --git a/frontend/src/app/board/page.tsx b/frontend/src/app/board/page.tsx index b061627..39b43b5 100644 --- a/frontend/src/app/board/page.tsx +++ b/frontend/src/app/board/page.tsx @@ -10,7 +10,8 @@ import { useTranslate } from '@/lib/useTranslate'; export default function BoardPage() { const router = useRouter(); const searchParams = useSearchParams(); - const { user, isLoggedIn } = useAuthStore(); + const { user, token } = useAuthStore(); + const isLoggedIn = !!token && !!user; const { translate, language } = useTranslate(); const [posts, setPosts] = useState([]); diff --git a/frontend/src/app/board/write/page.tsx b/frontend/src/app/board/write/page.tsx index f9e10b0..e0c8393 100644 --- a/frontend/src/app/board/write/page.tsx +++ b/frontend/src/app/board/write/page.tsx @@ -9,7 +9,8 @@ import { useTranslate } from '@/lib/useTranslate'; export default function BoardWritePage() { const router = useRouter(); - const { user, isLoggedIn } = useAuthStore(); + const { user, token } = useAuthStore(); + const isLoggedIn = !!token && !!user; const { translate, language } = useTranslate(); const [categories, setCategories] = useState([]);