SearchJobs uses cookie-based JWT authentication. When you log in, the server generates a signed JWT and stores it in an HttpOnly cookie namedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Esteban-Mendez-j/Proyecto-Docker/llms.txt
Use this file to discover all available pages before exploring further.
jwtToken. All subsequent requests send this cookie automatically — you never need to manage tokens or set Authorization headers manually.
Overview
The authentication flow works as follows:- You submit credentials to
POST /api/usuarios/login. - On success, the server sets a
jwtTokenHttpOnly cookie on the response. - Your browser sends that cookie with every request automatically.
- The server validates the cookie on each request and establishes your security context.
- To end the session, call
POST /api/usuarios/cerrarSesion, which clears both thejwtTokenandJSESSIONIDcookies.
Login
Submit credentials asapplication/x-www-form-urlencoded form data. The username field must be the user’s email address.
The user’s email address.
The user’s password.
jwtToken cookie (HttpOnly, Secure, SameSite=None, Path=/, Max-Age=3600) and returns a JSON body with the authenticated user’s roles.
All roles assigned to the authenticated user (e.g.,
["ROLE_CANDIDATO"]).The user’s primary role. One of
CANDIDATO, EMPRESA, ADMIN, or SUPER_ADMIN.Logout
Invalidates the current HTTP session and clears both thejwtToken and JSESSIONID cookies by setting them to Max-Age=0.
HTTP status code
401, indicating the session is now closed.A confirmation message. Value:
"Sesión Cerrada".Token validation
The JWT is validated automatically on every request via thejwtToken cookie. You do not need to set an Authorization header — the browser sends the cookie transparently.
The server verifies the token’s signature using HMAC256 and confirms the issuer. If the token is valid, your identity and roles are established for that request. If the token is missing or invalid, you are treated as an unauthenticated visitor (ROLE_INVITADO).
Getting the current user’s role
You can query the authenticated user’s role at any time without side effects.jwtToken cookie is absent or invalid, it returns ROLE_INVITADO instead of an error.
The user’s primary role. One of
CANDIDATO, EMPRESA, ADMIN, SUPER_ADMIN, or ROLE_INVITADO when not authenticated.All roles assigned to the user. Contains only
ROLE_INVITADO when not authenticated.The authenticated user’s numeric ID. Not present when the user is not authenticated.
Token expiration
Token lifetime is controlled by theJWT_EXPIRATION environment variable, which specifies the duration in milliseconds. A value of 86400000 (24 hours) is recommended for production.
When a token expires, the next request to a protected endpoint returns 401 Unauthorized. The user must log in again to obtain a new token. There is no refresh mechanism — re-authentication is required.
Error responses
| Status | Error | Cause |
|---|---|---|
401 Unauthorized | TOKEN_EXPIRED | The jwtToken cookie is present but has expired. |
401 Unauthorized | INVALID_TOKEN | The token signature is invalid or the payload is malformed. |
401 Unauthorized | (no body) | Credentials were rejected during login. |