8ed0113d6d
Next.js "Collecting page data" worker crashes silently when a server component calls auth() or prisma without DATABASE_URL at build time. force-dynamic skips static generation for these pages entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 lines
276 B
TypeScript
13 lines
276 B
TypeScript
export const dynamic = "force-dynamic";
|
|
|
|
import { redirect } from "next/navigation";
|
|
import { auth } from "@/lib/auth";
|
|
|
|
export default async function Home() {
|
|
const session = await auth();
|
|
if (session?.user) {
|
|
redirect("/dashboard");
|
|
}
|
|
redirect("/auth/login");
|
|
}
|