Skip to main content

Endpoint

Authenticates a user with their email and password credentials. Returns user information on successful authentication.

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:
  1. Password verification always runs, even if the user doesn’t exist
  2. A dummy bcrypt hash is used when the user is not found
  3. 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:

Register

Create a new user account

Change Password

Update user password