import { NextResponse, type NextRequest } from "next/server"; /** * Preview (WEBSITE-1.0-PLAN ยง4): a signed-in admin sees the working copy on the site's own * addresses, fully clickable. The cookie only asks for it; the backend checks the admin's session * on every page (site/preview), so it shows nothing to anyone else. */ export function GET(request: NextRequest) { const res = NextResponse.redirect(new URL("/", request.url), 303); res.cookies.set("ccw_preview", "admin", { httpOnly: true, sameSite: "lax", secure: process.env.NODE_ENV === "production", path: "/" }); return res; }