Force dynamic rendering on layouts/pages reading DB (fix redirect loop from cached static prerender)
This commit is contained in:
parent
19bbce4787
commit
355db7d348
3 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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}</>;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue