import { WEBHOOK_SECRET } from "@mcpedia/config"; import { cookies } from "next/headers"; import DocForm from "@/components/DocForm"; import Link from "next/link"; // GET /docs/create — show the create form. // Auth: requires the mcpedia_admin cookie (set via /api/auth/login). export default async function CreateDocPage({ searchParams, }: { searchParams: Promise<{ slug?: string; section?: string }>; }) { const params = await searchParams; const section = (params.section as "docs" | "writeups" | "research" | "notes") ?? "docs"; const slug = params.slug ?? ""; // Auth check: cookie must be present. const cookieStore = await cookies(); const adminCookie = cookieStore.get("mcpedia_admin"); if (!adminCookie?.value) { return (
You must be logged in to create documents.
Login