import { cookies } from "next/headers"; import { redirect } from "next/navigation"; import { COOKIE, checkPasscode, gateEnabled, makeToken } from "@/lib/auth"; import { Brand } from "@/components/Brand"; export const dynamic = "force-dynamic"; async function login(formData: FormData) { "use server"; const code = String(formData.get("passcode") ?? ""); const next = String(formData.get("next") ?? "/"); if (!checkPasscode(code)) redirect(`/access?error=1&next=${encodeURIComponent(next)}`); const jar = await cookies(); jar.set(COOKIE, makeToken(), { httpOnly: true, sameSite: "lax", secure: process.env.NODE_ENV === "production", path: "/", maxAge: 30 * 24 * 3600 }); redirect(next.startsWith("/") ? next : "/"); } export default async function AccessPage({ searchParams }: { searchParams: Promise<{ error?: string; next?: string }> }) { const sp = await searchParams; if (!gateEnabled()) redirect("/"); return (

Research console

This console observes live social runtimes and can start browser sessions on the cluster. Enter the access code.

{sp.error &&

Wrong code.

}
); }