The login endpoint authenticates an existing user by verifying their email and password against the stored bcrypt hash. When credentials are valid, the API returns a signed JWT token along with the user’s basic profile data. The same generic error message is returned for both an unknown email and a wrong password to prevent user enumeration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/floriansalvi/HEIG-VD_Ocha-api/llms.txt
Use this file to discover all available pages before exploring further.
No authentication is required for this endpoint. It is publicly accessible.
POST Path: /api/v1/auth/login
Request body
The registered email address of the user. Matched case-insensitively (normalized to lowercase internally).
The user’s password in plain text. Compared against the bcrypt hash stored at registration.
Response — 200 OK
Human-readable confirmation. Value:
"Login successful".Signed JWT authentication token. Include this in the
Authorization: Bearer <token> header for protected endpoints.Basic profile data for the authenticated user.
Error codes
| Status | Meaning | Cause |
|---|---|---|
400 Bad Request | Missing required field | email or password is absent from the request body |
401 Unauthorized | Invalid credentials | The email is not registered, or the password does not match |
500 Internal Server Error | Unexpected error | An unhandled server-side error occurred |