diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx index 44cef7c8a..c8291060a 100644 --- a/src/app/(auth)/layout.tsx +++ b/src/app/(auth)/layout.tsx @@ -2,10 +2,16 @@ import { Think } from "ui/think"; import { getTranslations } from "next-intl/server"; import { FlipWords } from "ui/flip-words"; import { BackgroundPaths } from "ui/background-paths"; +import { getSession } from "lib/auth/server"; +import { redirect } from "next/navigation"; export default async function AuthLayout({ children, }: { children: React.ReactNode }) { + const session = await getSession(); + if (session) { + redirect("/"); + } const t = await getTranslations("Auth.Intro"); return (