diff --git a/stripe_to_invoice/app/page.tsx b/stripe_to_invoice/app/page.tsx index 0d1db2d..3c95830 100644 --- a/stripe_to_invoice/app/page.tsx +++ b/stripe_to_invoice/app/page.tsx @@ -7,7 +7,18 @@ // // Everything else lives elsewhere. -export default function Home() { +import { cookies } from "next/headers"; +import { redirect } from "next/navigation"; + +export default async function Home() { + const cookieStore = await cookies(); + const session = cookieStore.get("session"); + + // ✅ If already logged in, go straight to app + if (session) { + redirect("/app"); + } + return (
@@ -58,5 +69,5 @@ export default function Home() {
- ) + ); }