Botica Nova Salud uses JSON Web Tokens (JWT) for authentication. You log in with a username and password, receive a token, and then include that token in every subsequent API request. Tokens are valid for 8 hours, after which you must log in again.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/15aozzz/Lab-Nova-Salud/llms.txt
Use this file to discover all available pages before exploring further.
Logging in
Send aPOST request to /api/auth/login with your credentials in the request body:
Request body
Successful response
token value — you will include it in all subsequent requests.
Making authenticated requests
Add the token to theAuthorization header of every request to a protected endpoint:
Protected routes
All routes except/ (the login page) require authentication. A request to a protected route without a valid token returns a 401 response immediately, before any business logic runs.
Token expiry
Tokens expire 8 hours after they are issued. Once a token expires, requests return401 Token inválido. The user must log in again to obtain a new token.
Error responses
| Status | Error message | Meaning |
|---|---|---|
401 | Usuario no encontrado | No account exists with the given username. |
401 | Contraseña incorrecta | The username exists but the password does not match. |
401 | Token requerido | The Authorization header is missing from the request. |
401 | Token inválido | The token is malformed, has been tampered with, or has expired. |
Test credentials
The database seed data includes two accounts you can use immediately after setup:| Username | Password | Role |
|---|---|---|
admin | admin123 | Administrador |
cajero1 | admin123 | Cajero |
Change these passwords before deploying to any environment accessible outside your local machine.