This commit is contained in:
2026-04-19 13:22:48 +03:00
parent 1c1d87176e
commit 538612c8ea
14 changed files with 661 additions and 42 deletions
+11 -1
View File
@@ -1,5 +1,9 @@
import { getTranslations } from "next-intl/server";
import AdminContent from "@/components/admin/admin-content";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { isAdminRole } from "@/lib/auth/roles";
import { getServerSession } from "next-auth";
import { notFound } from "next/navigation";
export async function generateMetadata() {
const t = await getTranslations();
@@ -10,6 +14,12 @@ export async function generateMetadata() {
};
}
export default function AdminPage() {
export default async function AdminPage() {
const session = await getServerSession(authOptions);
if (!isAdminRole(session?.user?.roles)) {
notFound();
}
return <AdminContent />;
}