Enable authentication globally. Until this is called, auth is disabled and
every resource is publicly accessible (convenient for quick starts / tests).
Validate credentials against the admin table and, on success, redirect to the
dashboard with the auth cookie set. csrf is the submitted hidden field; it
must match the CSRF cookie or the post is rejected before any lookup.
Clear the auth cookie and return to the login page. Logout is client-side:
it removes the browser’s cookie but cannot invalidate a token already copied
elsewhere — that token remains valid until it expires (token_ttl_secs). To
force-revoke sessions, rotate jwt_secret (kills all) or wait out a short TTL.
Setup page: shows a QR + secret and asks the user to confirm a code to enable
MFA. Skippable — the “Skip for now” link just goes back to the dashboard.