fosrl.pangolin/src/app/setup/layout.tsx

27 lines
580 B
TypeScript
Raw Normal View History

import { verifySession } from "@app/lib/auth/verifySession";
import { Metadata } from "next";
import { redirect } from "next/navigation";
import { cache } from "react";
export const metadata: Metadata = {
title: `Setup - Pangolin`,
description: "",
};
export const dynamic = "force-dynamic";
2024-10-19 16:37:40 -04:00
export default async function SetupLayout({
children,
}: {
children: React.ReactNode;
}) {
const getUser = cache(verifySession);
const user = await getUser();
if (!user) {
redirect("/");
}
2024-10-19 16:37:40 -04:00
return <div className="mt-32">{children}</div>;
}