GET /usuarios/me
Returns the profile information for the currently authenticated user based on the JWT token.Authentication
Required: Bearer token (JWT) in the Authorization header
Request
No request body or parameters required. The user is identified from the JWT token.cURL
Python
JavaScript
Response
User’s unique identifier (MongoDB ObjectId)
User’s full name
User’s email address
User’s role:
visitante, editor, or adminExample Response
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing JWT token |
| 403 | Forbidden - Token expired or malformed |
Use Cases
- Display user profile information in the frontend
- Verify the current user’s role before showing role-specific UI
- Fetch user details after login
- Check authentication status
Implementation Reference
This endpoint is implemented insrc/infrastructure/api/routers/usuario_router.py:24-32:
get_current_user dependency (from jwt_utils.py) decodes the JWT token and returns the user data.
Related Documentation
- Login - Get a JWT token
- Update User - Update your profile
- User Roles - Learn about role permissions