17 lines
317 B
TypeScript
17 lines
317 B
TypeScript
import { auth } from "@/lib/auth";
|
|
import { redirect } from "next/navigation";
|
|
|
|
export default async function ProtectedAdminLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const session = await auth();
|
|
|
|
if (!session) {
|
|
redirect("/admin/login");
|
|
}
|
|
|
|
return children;
|
|
}
|