Use this file to discover all available pages before exploring further.
The POST /api/v1/auth/login endpoint authenticates a registered user by verifying their email and password against the stored bcrypt hash. On success it returns a signed JSON Web Token, the token’s expiry duration, the user object (without password), sidebar navigation items for the user’s role, and a flat list of URI permission strings the role can access.No authentication token is required to call this endpoint.
Returned when credentials are valid. The response includes the JWT token, its expiry, the authenticated user, role-based sidebar items, and the full list of nameUri permission strings for the user’s role.
Ordered list of navigation items the user’s role is permitted to see in the frontend sidebar. Each item is sourced from the sidebarItems table via the roleXItem pivot.
Flat array of nameUri strings representing every API route the user’s role can call (e.g., "GET /api/v1/users", "PUT /api/v1/users/:id"). Sourced from the permissions table via the permissionXRole pivot.
Returned when no user exists with the provided email, or the password does not match the stored bcrypt hash. The service throws UnauthorizedError('Credenciales inválidas').
Store the token value in a secure location (e.g., an httpOnly cookie or a secure in-memory store — avoid localStorage in sensitive applications). Include it in all subsequent protected API requests via the Authorization header:
Authorization: Bearer <token>
Once the token expires (see expiresIn), the user must log in again to obtain a new one.