diff --git a/src/app/(auth)/sign-in/page.tsx b/src/app/(auth)/sign-in/page.tsx index a02c5b7..c77e7f9 100644 --- a/src/app/(auth)/sign-in/page.tsx +++ b/src/app/(auth)/sign-in/page.tsx @@ -1,8 +1,12 @@ -"use client"; - +import { redirect } from "next/navigation"; +import { getCurrent } from "@/features/auth/actions"; import { SignInCard } from "@/features/auth/components/sign-in-card"; -const SignInPage = () => { +const SignInPage = async () => { + const user = await getCurrent(); + + if (user) redirect("/"); + return ; }; diff --git a/src/app/(auth)/sign-up/page.tsx b/src/app/(auth)/sign-up/page.tsx index 00c76fb..1c5aa16 100644 --- a/src/app/(auth)/sign-up/page.tsx +++ b/src/app/(auth)/sign-up/page.tsx @@ -1,8 +1,12 @@ -"use client"; - +import { redirect } from "next/navigation"; +import { getCurrent } from "@/features/auth/actions"; import { SignUpCard } from "@/features/auth/components/sign-up-card"; -const SignUpPage = () => { +const SignUpPage = async () => { + const user = await getCurrent(); + + if (user) redirect("/"); + return ; };