mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-26 02:58:48 -06:00
15 lines
509 B
TypeScript
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}</>;
|
|
};
|