Files
formbricks/apps/web/modules/setup/(fresh-instance)/layout.tsx
2025-10-20 14:28:14 +00:00

15 lines
509 B
TypeScript

import { getServerSession } from "next-auth";
import { notFound } from "next/navigation";
import { getIsFreshInstance } from "@/lib/instance/service";
import { authOptions } from "@/modules/auth/lib/authOptions";
export const FreshInstanceLayout = async ({ children }: { children: React.ReactNode }) => {
const session = await getServerSession(authOptions);
const isFreshInstance = await getIsFreshInstance();
if (session || !isFreshInstance) {
return notFound();
}
return <>{children}</>;
};