From 7404afe4662b23ff706cfd63b055f73e7b9aa99b Mon Sep 17 00:00:00 2001 From: Maulana Sodiqin Date: Tue, 25 Nov 2025 11:01:41 +0700 Subject: [PATCH] fix: allow landing page to be viewed without authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove automatic redirect from "/" to login/dashboard - Allow everyone to view the hackathon landing page - Users can still click "Daftar Sekarang" to go to login This fixes the issue where the landing page immediately redirected to login. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/hackathon/src/app/layout.tsx | 10 ++-------- apps/hackathon/src/middleware.ts | 3 +-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/apps/hackathon/src/app/layout.tsx b/apps/hackathon/src/app/layout.tsx index 3f79c52..cbd1151 100644 --- a/apps/hackathon/src/app/layout.tsx +++ b/apps/hackathon/src/app/layout.tsx @@ -54,15 +54,9 @@ export default function RootLayout() { return; } - // Home page - redirect based on auth status + // Home page - allow everyone to view the landing page if (pathname === '/') { - if (session) { - console.log('[Layout] Already authenticated, redirecting to dashboard'); - navigate('/dashboard', { replace: true }); - } else { - console.log('[Layout] Not authenticated, redirecting to login'); - navigate('/auth/login', { replace: true }); - } + console.log('[Layout] Landing page, allowing access'); setIsChecking(false); return; } diff --git a/apps/hackathon/src/middleware.ts b/apps/hackathon/src/middleware.ts index 34a5e62..28ed9e0 100644 --- a/apps/hackathon/src/middleware.ts +++ b/apps/hackathon/src/middleware.ts @@ -53,9 +53,8 @@ export const middleware = async ({ request }: LoaderFunctionArgs) => { return null; } - // Public routes - redirect to dashboard if already authenticated + // Public routes - allow everyone to view the landing page if (mappingPublicRoutes.includes(pathname)) { - if (supabaseSession) return redirect('/dashboard'); return null; }