From 355db7d348f9b293b487ed0cb11f6ecf3bed3d71 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Fri, 1 May 2026 18:19:59 +0200 Subject: [PATCH] Force dynamic rendering on layouts/pages reading DB (fix redirect loop from cached static prerender) --- app/(app)/layout.tsx | 2 ++ app/(auth)/layout.tsx | 2 ++ app/page.tsx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/(app)/layout.tsx b/app/(app)/layout.tsx index 3c455cf..f6985f3 100644 --- a/app/(app)/layout.tsx +++ b/app/(app)/layout.tsx @@ -5,6 +5,8 @@ import { isSetupComplete } from "@/lib/db"; import { Sidebar } from "@/components/Sidebar"; import { UpdateBanner } from "@/components/UpdateBanner"; +export const dynamic = "force-dynamic"; + export default async function AppLayout({ children }: { children: React.ReactNode }) { if (!isSetupComplete()) redirect("/setup"); const session = await getServerSession(authOptions); diff --git a/app/(auth)/layout.tsx b/app/(auth)/layout.tsx index ba540d4..bfd0174 100644 --- a/app/(auth)/layout.tsx +++ b/app/(auth)/layout.tsx @@ -1,6 +1,8 @@ import { redirect } from "next/navigation"; import { isSetupComplete } from "@/lib/db"; +export const dynamic = "force-dynamic"; + export default function AuthLayout({ children }: { children: React.ReactNode }) { if (!isSetupComplete()) redirect("/setup"); return <>{children}; diff --git a/app/page.tsx b/app/page.tsx index 889dfdc..61161f9 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -3,6 +3,8 @@ import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/auth"; import { isSetupComplete } from "@/lib/db"; +export const dynamic = "force-dynamic"; + export default async function RootPage() { if (!isSetupComplete()) redirect("/setup"); const session = await getServerSession(authOptions);