This endpoint verifies the user’s email and password, checks the user role (
user), and returns a JWT token upon successful authentication.
Request Body
The user’s email address
The user’s password
Example Request
Example Response
Success Response
| Status | Description |
|---|---|
| 200 OK | User authenticated successfully; returns access_token, role, and user_id |
Error Responses
| Status | Description | Example |
|---|---|---|
| 401 Unauthorized | Invalid credentials or role mismatch | json { "detail": "Unauthorized: Invalid credentials." } |
| 404 Not Found | User email not found | json { "detail": "Not Found: User not found." } |
| 500 Internal Server Error | Unexpected server error | json { "detail": "An unexpected error occurred" } |