Authentication
Summary
Password-based login with Bearer tokens. The login form is a standard ScreenContract rendered by the same card renderer used for everything else.
User-facing behavior
First launch (no stored token)
- Client tries to load the main menu
- Server returns
401 Unauthorized - Client fetches the login screen (
GET /auth/login) - Server returns a Card with username and password fields
- User fills fields and presses Enter
- Client submits credentials (
POST /auth/login) - Server returns a token and the main menu
- Client stores the token and renders the menu
Subsequent launch (stored token)
- Client loads the stored token
- Client fetches the main menu with the token
- Server returns the menu
Token expired mid-session
- Any request returns
401 Unauthorized - Client clears the token and screen stack
- Client redirects to the login screen
Logout
The quit modal (when authenticated) offers a "Log Out" option that clears the token and returns to the login screen.