AuthEmail/password login

Email/password login

On correct password, normally returns the user object and sets the access JWT cookie. If the account has MFA enabled, returns { "mfa_required": true } (HTTP 200) and sets the slugbase.mfa_pending cookie instead of issuing an access JWT until POST /api/auth/mfa/verify succeeds. Failed credentials always return 401 (no mfa_required) to avoid account enumeration.

curl -X POST "https://slugbase.app/api/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "user@example.com",
  "password": "example_string"
}'
{
  "id": "example_string",
  "email": "user@example.com",
  "name": "John Doe",
  "user_key": "example_string",
  "is_admin": true,
  "email_verified": true,
  "language": "example_string",
  "theme": "example_string"
}
POST
/api/auth/login
POST
Content-Typestring
Required

The media type of the request body

Options: application/json
Request Preview
Response

Response will appear here after sending the request

Body

application/json

Responses

idstring
emailstring
namestring
user_keystring
is_adminboolean
email_verifiedboolean
languagestring
themestring