feat(admin): Server Action'larla kullanıcı yönetimi ve gerçek oturumlu sayfalar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-05 02:02:00 +03:00
parent 5191a5cce1
commit 2035f73e7d
18 changed files with 437 additions and 270 deletions
+4 -8
View File
@@ -1,11 +1,7 @@
import { notFound } from "next/navigation";
import { MOCK_SESSION_USER } from "@/features/auth/mock";
import { requireRole } from "@/lib/dal";
/**
* Yalnızca sistem admini. Admin olmayana 404 (sayfanın varlığını bile göstermez).
* FAZ 3: `await requireRole("admin")` (lib/dal.ts) — sunucu tarafı gerçek kontrol.
*/
export default function AdminLayout({ children }: { children: React.ReactNode }) {
if (MOCK_SESSION_USER.role !== "admin") notFound();
/** Yalnızca sistem admini; diğerlerine 404. Sayfalar ayrıca kendi kontrolünü yapar. */
export default async function AdminLayout({ children }: { children: React.ReactNode }) {
await requireRole("admin");
return children;
}