'use client'; import { useActionState } from 'react'; import { loginAction } from '@/lib/admin/actions'; /** Login form: posts the token to a server action; the token only ever travels in this request body and the httpOnly cookie. */ export function LoginForm({ hint }: { hint?: string | null }) { const [state, action, pending] = useActionState(loginAction, { error: null }); return (
{state?.error && (

{state.error}

)} {!state?.error && hint &&

{hint}

}

The token is validated against the API and kept in an httpOnly cookie for 12 hours. It is never sent to the browser.

); }