The login endpoint validates a user’s credentials against the stored bcrypt hash and, on success, issues a signed JSON Web Token (JWT). This token must be included in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header for all protected endpoints. The token is valid for 7 days from the moment of issuance. Accounts that have not completed email verification, or that have been deactivated, are blocked from logging in even if the password is correct.
Endpoint
Authentication
None required. This endpoint is publicly accessible.Request Body
The email address used during registration.
The account’s plain-text password. Compared against the stored bcrypt hash server-side.
Request Example
Response — 200 OK
Confirmation string:
"Login exitoso".A signed HS256 JWT Bearer token. Include this value in the
Authorization header of subsequent requests.The authenticated user’s email address.
The user’s
first_name as stored in the database.true if the user has admin privileges, false otherwise.JWT Token Details
The token is signed with the application’sSECRET_KEY using the HS256 algorithm. The decoded payload contains:
| Claim | Type | Description |
|---|---|---|
user_id | string | The user’s MongoDB ObjectId, serialized as a string |
email | string | The user’s email address |
is_admin | boolean | Whether the account has admin privileges |
exp | integer | Unix timestamp — exactly 7 days from the moment of issuance |
Using the Token
Include the token in theAuthorization header of every request to a protected endpoint:
401 Unauthorized.
Error Responses
| Status | Body | Cause |
|---|---|---|
401 | { "error": "Credenciales incorrectas" } | Email not found, or password does not match the stored hash |
403 | { "error": "Cuenta desactivada. Contacta al soporte." } | Account exists but is_active is False (soft-deleted) |
403 | { "error": "Debes verificar tu correo antes de iniciar sesión" } | Account exists and password is correct, but is_verified is False |
400 | Serializer validation errors | Malformed request body (e.g. missing fields) |
Both “email not found” and “wrong password” return the same
401 response with "Credenciales incorrectas". This is intentional — identical error messages prevent user enumeration attacks.