Skip to Content
🎉 New release with new features and improvements! V0.0.4 Release →

Login

Authenticate a user with email and password.

POST /api/auth/login

The system will automatically set authentication cookies bsh_access_token and bsh_refresh_token with the generated tokens upon login.

Password requirements:

  • Length: 6-12 characters.
  • At least one uppercase letter.
  • At least one lowercase letter.
  • At least one number.

The system uses the secret env:jwt.secret to generate access tokens.
Before starting the instance, make sure to provide your JWT secret via environment variables as described here.

Request Body

{ "email": "user@example.com", "password": "password123" }

Response

{ "data": [ { "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", } ] ... }

User Status

StatusDescriptioncan login
ACTIVATEDUser account is activated.Yes
REQUIRED_ACTIVATIONUser account is not activated.No
REQUIRED_RESET_PASSWORDUser need to reset the password.No
DISABLEDUser account is disabled.No
LOCKEDUser account is locked.No