From 23ddcb6f4d01fd1e14deb71b73031cdf7e338373 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 00:16:11 +0000 Subject: [PATCH] feat: redirect logged-in users from homepage to dashboard - Add server-side auth check using Clerk's auth() function - Redirect authenticated users to /dashboard automatically - Preserve homepage content for unauthenticated users - Resolves issue #4 Co-authored-by: Tom Phillips --- src/app/page.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index a932894..9706075 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,13 @@ import Image from "next/image"; +import { auth } from "@clerk/nextjs/server"; +import { redirect } from "next/navigation"; -export default function Home() { +export default async function Home() { + const { userId } = await auth(); + + if (userId) { + redirect('/dashboard'); + } return (