Files
record-app-next/app/page.tsx
2025-07-31 17:05:07 +08:00

14 lines
329 B
TypeScript

import { getServerSession } from "next-auth/next";
import { redirect } from "next/navigation";
import { authOptions } from "@/lib/auth";
export default async function HomePage() {
const session = await getServerSession(authOptions);
if (session?.user) {
redirect("/dashboard");
} else {
redirect("/login");
}
}