The Vacaciones API uses JSON Web Tokens (JWT) for authentication. Every protected endpoint requires a valid token in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/CKoldo/Vacaciones-front/llms.txt
Use this file to discover all available pages before exploring further.
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
The account username.
The account password.
A signed JWT. Include this value in the
Authorization header of subsequent requests.Token payload
The JWT payload contains the following claims:| Claim | Type | Description |
|---|---|---|
id | string | The user’s unique identifier |
username | string | The user’s login name |
role | "admin" | "user" | The user’s role |
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.
