From 4af93cae1ca54ad7c9bc7eb4b56c010f55c4c72d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 17:53:55 +0000 Subject: feat: allow viewing/spectating games without login Make watch, ranking, game list, and tournament endpoints accessible without authentication. Unauthenticated users can browse games and spectate from the index page, while play/submit/preview still require login. https://claude.ai/code/session_019j9tNcnLsLz15e1qtbmeqe --- frontend/app/pages/DashboardPage.tsx | 54 +++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 20 deletions(-) (limited to 'frontend/app/pages/DashboardPage.tsx') diff --git a/frontend/app/pages/DashboardPage.tsx b/frontend/app/pages/DashboardPage.tsx index 00db3f0..92c0f04 100644 --- a/frontend/app/pages/DashboardPage.tsx +++ b/frontend/app/pages/DashboardPage.tsx @@ -14,7 +14,7 @@ type Game = components["schemas"]["Game"]; export default function DashboardPage() { usePageTitle(`Dashboard | ${APP_NAME}`); - const { user, logout } = useAuth(); + const { user, isLoggedIn, isLoading: authLoading, logout } = useAuth(); const [, navigate] = useLocation(); const [games, setGames] = useState([]); @@ -33,7 +33,7 @@ export default function DashboardPage() { navigate("/"); } - if (loading) { + if (loading || authLoading) { return (

Loading...

@@ -43,18 +43,24 @@ export default function DashboardPage() { return (
- {user?.icon_path && ( + {isLoggedIn && user?.icon_path && ( )} -

{user?.display_name}

+ {isLoggedIn ? ( +

+ {user?.display_name} +

+ ) : ( +

試合一覧

+ )}
{games.length === 0 ? ( -

エントリーできる試合はありません

+

試合はありません

) : (
    {games.map((game) => ( @@ -68,20 +74,24 @@ export default function DashboardPage() {
- {game.started_at == null && ( + {isLoggedIn && game.started_at == null && ( 問題を見る )} - - 対戦 - + {isLoggedIn && ( + + 対戦 + + )} 観戦 - - 提出履歴 - + {isLoggedIn && ( + + 提出履歴 + + )}
))} @@ -89,14 +99,18 @@ export default function DashboardPage() { )}
- - {user?.is_admin && ( + {isLoggedIn ? ( + + ) : ( + ログイン + )} + {isLoggedIn && user?.is_admin && (