Endpoint
Request Body
string
required
User’s email address
string
required
User’s password (minimum 8 characters)
Response
integer
User’s unique database ID
string
User’s email address
string
User’s display name (may be null)
Example Request
cURL
JavaScript
Python
Example Response
Security Notes
Timing Attack Prevention
The login endpoint implements protection against timing attacks:- Password verification always runs, even if the user doesn’t exist
- A dummy bcrypt hash is used when the user is not found
- This ensures consistent response times regardless of whether the user exists
Password Verification
- Passwords are verified using bcrypt’s secure comparison
- Original password is never stored or logged
- Only the bcrypt hash is stored in the database
Error Handling
Frontend Integration
The frontend uses Auth.js (NextAuth.js) for authentication:Related Endpoints
Register
Create a new user account
Change Password
Update user password