Documentation Index
Fetch the complete documentation index at: https://mintlify.com/akibanks/api-tienda-vinilos/llms.txt
Use this file to discover all available pages before exploring further.
POST /login authenticates a user and returns a signed JWT token. The token encodes the user’s ID, username, and role and is valid for 7 days. Once obtained, send it as Authorization: Bearer <token> on all protected endpoints.
Endpoint details
| Property | Value |
|---|---|
| Method | POST |
| Path | /login |
| Auth | None required |
| Rate limit | 10 requests per 15 minutes |
| Token expiry | 7 days (7d) |
Request body
The username of the account to authenticate. Leading and trailing whitespace
is trimmed before the lookup.
The account password to verify against the stored bcrypt hash.
Example request
Responses
200 OK
Authentication succeeded. The response body contains the signed token and role flags for the client to store and use.A signed JWT. The payload encodes
id (the user’s numeric ID), nombre
(username), and rol (the user’s role string). Valid for 7 days from
the time of issue.The authenticated user’s username as stored in the database.
true when the user’s role is admin; false otherwise.true when the user’s role is demo; false otherwise. Demo accounts have
read-only access to admin-scoped resources.400 Bad Request — Missing fields
Returned whennombre_usuario (after trimming) or password is absent or empty.
401 Unauthorized — Invalid credentials
Returned when the username does not exist or when the password does not match the stored hash. Both cases return the same message to prevent username enumeration.429 Too Many Requests — Rate limit exceeded
Returned when the caller has sent more than 10 login requests within a 15-minute window.500 Internal Server Error
Returned when an unexpected server-side error occurs.Using the token
Store the token from the login response and pass it as aBearer token on subsequent requests to protected endpoints.
Even when a username does not exist in the database, the login endpoint
performs a constant-time bcrypt comparison against a dummy hash before
returning the 401 response. This ensures that the response time is
indistinguishable from a real failed-password attempt, preventing
timing-based user enumeration attacks.