UZDI uses token-based authentication. After a successful login the frontend stores the bearer token inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Zapiony/PUCE_UZDI_2026/llms.txt
Use this file to discover all available pages before exploring further.
localStorage under the key uzdi_token and the serialised user object under uzdi_user. Every subsequent HTTP request automatically attaches the token via an Axios request interceptor.
All endpoints share the global prefix
/api/v1. The examples in this page use that full path.How the token is used
The Vue 3 frontend configures a single shared Axios instance (src/services/api.ts). A request interceptor reads uzdi_token from localStorage and injects it as an Authorization header on every outgoing request:
src/services/api.ts
POST /api/v1/auth/login
Authenticates a user by comparing the supplied plain-text password against the bcrypt hash stored inseguridad.prsn. The service queries both the prsnlogn and prsnmail columns, so the login field accepts either a login handle or a registered email address. On success the service strips the password field from the returned user object before sending the response.
Authentication required: None
Request body
The user’s login handle or registered email address. The service queries both the
prsnlogn and prsnmail columns, so either value is accepted.Plain-text password. The service verifies it with
bcrypt.compare() against the stored hash — the raw value is never persisted.Success response — 200 OK
Human-readable confirmation. Always
'Login exitoso' on success.Bearer token to include in subsequent requests as
Authorization: Bearer {token}.The authenticated user record. The
password field is deleted before the object is returned — all other entity columns are included.Error responses
| Status | Body | Cause |
|---|---|---|
401 Unauthorized | { "message": "Credenciales inválidas", "statusCode": 401 } | User not found or bcrypt comparison failed. The service returns the same message for both cases to avoid user enumeration. |
400 Bad Request | Validation error array | login or password field is missing or empty (enforced by ValidationPipe). |
Examples
POST /api/v1/auth/change-password
Updates the password of an existing user. The service re-validates the current password with bcrypt before hashing and persisting the new one. Authentication required: Bearer token (Authorization: Bearer {token})
Request body
Numeric ID of the user whose password is being changed (matches
prsn_id / User.id).The user’s current plain-text password. Verified against the stored bcrypt hash before any update is applied.
The desired new password in plain text. Must be at least 8 characters (enforced by the frontend; the backend hashes whatever is sent with a cost factor of
10).Success response — 200 OK
Always
'Contraseña actualizada correctamente' on success.Error responses
| Status | Body | Cause |
|---|---|---|
401 Unauthorized | { "message": "Usuario no encontrado", "statusCode": 401 } | No user exists with the given userId. |
401 Unauthorized | { "message": "Contraseña actual incorrecta", "statusCode": 401 } | currentPassword did not match the stored bcrypt hash. |
Example
Token storage and session lifecycle
localStorage key | Value | Set when |
|---|---|---|
uzdi_token | Bearer token string | Successful login |
uzdi_user | JSON-serialised user object | Successful login |
401 Unauthorized. After clearing, the user is redirected to /login:
Explicit logout (clicking the sidebar logout button) also navigates to
/login. If you need to programmatically end a session, remove both localStorage keys before redirecting.