Login
Authenticates a user with their email and password credentials. Upon successful authentication, returns a JWT access token and sets it as an HTTP-only cookie.Endpoint
Request Body
User’s email address. Must be a valid email format.
User’s password.
Response
Success message indicating login was successful.
JWT access token for authenticated requests. This token contains the user’s ID and email.
The access token is also automatically set as an HTTP-only cookie named
access_token with the following properties:- HttpOnly: true (prevents JavaScript access)
- SameSite: lax
- Path: /
- Domain: localhost
- Max-Age: 10 days (864000 seconds)
Example Request
Example Response
Error Responses
401 Unauthorized
Returned when the email or password is invalid.400 Bad Request
Returned when required fields are missing.500 Internal Server Error
Returned when a database or server error occurs.JWT Token Payload
The JWT token contains the following claims:userId: The user’s unique identifieremail: The user’s email address
Authorization header for authenticated requests: