"use client"; import { useActionState } from "react"; interface State { token: string | null; error: string | null; } interface Props { action: (prev: State) => Promise; ttlDays: number; } const initial: State = { token: null, error: null }; export default function ConnectForm({ action, ttlDays }: Props) { const [state, formAction, pending] = useActionState(action, initial); return (
{state.token ? ( <>

New token (copy now — won't be shown again)

            {state.token}
          

Add to Claude Code

{`claude mcp add --transport http \\
  --header "Authorization: Bearer ${state.token}" \\
  shared-memory https://memory.dnspegasus.net/api/mcp`}

Valid for {ttlDays} days. To revoke all outstanding CLI tokens at once, rotate CLI_TOKEN_SECRET on the server.

) : (
{state.error ? (

error: {state.error}

) : null}

Tokens carry your full Authentik identity. Valid for {ttlDays}{" "} days. Treat them like a password.

)}
); }