The login endpoint authenticates a registered user by verifying their username and password against the stored credentials. On a successful authentication it revokes any previously issued tokens for that user and returns a fresh JWT access token together with a new refresh token, ensuring that only one active session exists at a time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/CristianRR94/springCommunity/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
Request Body
The user’s username — the
nombre field set during registration. Authentication is performed by username, not by email address.The user’s account password in plain text. The server validates it against the stored BCrypt hash.
Request Example
Response
A200 OK response with a JSON body containing both tokens.
A signed JWT access token. Include this in the
Authorization: Bearer <token> header for all protected requests. Default TTL: 1 hour (configurable via JWT_EXPIRATION).A signed JWT refresh token. Use this with
POST /auth/refresh to obtain a new token pair once the access token expires. Default TTL: 7 days (configurable via JWT_REFRESH_EXPIRATION).Response Example
Error Responses
| Status | Condition |
|---|---|
400 Bad Request | Missing required fields — either nombre or password is blank or absent in the request body. |
404 Not Found | No user with the given nombre exists in the database. |
401 Unauthorized | The provided password does not match the stored credentials for the given username. |