Authorization header. The only endpoint that does not require a token is POST /api/auth/login.
Obtaining a token
Exchange a username and password for a JWT by calling the login endpoint.POST /api/auth/login
string
required
The account username.
string
required
The account password.
string
required
A signed JWT. Include this value in the
Authorization header of subsequent requests.Token payload
The JWT payload contains the following claims:
You can decode the payload client-side with standard base64 decoding. The front end reads the payload to populate the authenticated user context:
Using the token
Include the token as a Bearer credential in theAuthorization header on every protected request:
localStorage under the key token and attaches it automatically to every apiFetch call.
Token expiry and logout
When the user logs out, the front end removes the token fromlocalStorage. The server does not provide a token revocation endpoint; tokens remain valid until they expire according to their embedded exp claim.
401 Unauthorized
If a request is made with a missing or invalid token, the server responds with401 Unauthorized.
