Authentication and sessions
e0ed63ec61a069159a1482d1ecd11dd480a6a60f. Version 2026.11.0-rc.0. License MIT. Status: release candidate; not published, deployed, production-qualified or security-reviewed. This is the component's committed documentation, not proof of a distribution release or production qualification.
The administration UI is not an identity provider and does not render a sign-in
form. Interactive sign-in, recovery, device consent and recent-auth step-up are
owned by the separately served Melodee Auth UI, backed by melodee-api.
Browser session
- The operator navigates to the configured Auth UI entry (
/auth/loginby default, same origin). - The API sets an HttpOnly, same-origin browser session cookie and a
melodee_csrfcookie. No session token is returned to JavaScript. - The admin UI verifies the session with one authenticated
GET /api/v1/capabilitiesread. A401triggers exactly one cookie refresh attempt; a second401is an anonymous session. - Unsafe requests send
X-CSRF-Tokenread from the non-HttpOnlymelodee_csrfcookie. The API remains the authority for origin/CSRF checks. - Sign-out uses
POST /api/v1/auth/logout, which revokes the browser session through the API. The UI clears only in-memory session state.
No bearer token, refresh credential, magic-link secret or passkey object is written to local/session storage, IndexedDB, a URL, logs or analytics.
401 versus 403
401after the single refresh: session expired,/auth/requiredwith a safe internal continuation. The UI does not retry indefinitely and does not show a fake login form.403: authenticated but not permitted. The page keeps navigation and shows the restricted capability; it never enters a login loop.404: missing record with a safe back action.409/412: revision conflict; re-read and compare, never auto-overwrite.429: respect the cooldown; mutations are never retried automatically.
Capability discovery
The pinned API has no endpoint returning the caller's administrative
capabilities. The UI performs five bounded safe reads (job-controls, one
review, volumes, snapshots, one account) and treats the returned 200/403 as
the authoritative capability check. Results live in memory and refresh on
demand. A successful page read or a page 403 updates the same map. No hidden
control is treated as authorization.
Return-to-administration limitation
The Auth UI's continuation allowlist
(melodee-auth-ui/src/api/continuation.ts) contains only its own
/auth/account/* and /auth/device paths. It does not publish a
cross-application post-sign-in redirect. The admin UI therefore:
- links to the Auth UI and explains the boundary;
- accepts only a same-origin internal
returnTopath for its own/auth/requiredscreen; - never passes a token, code, account id or external URL.
A seamless automatic return requires an Auth UI/reverse-proxy change approved by the owner. This is an external integration blocker, not a reason to duplicate authentication.
Device consent
Device approval/denial stays in the Auth UI at /auth/device. The admin UI links
to it. There is no admin-wide pending-device or consent-grant list in the
contract, and the UI does not mutate consent.