Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Taykl12/Classify/llms.txt

Use this file to discover all available pages before exploring further.

The login endpoint validates credentials against Supabase Auth using signInWithPassword and returns a JWT access token, a refresh token, and the full user profile in a single response. After a successful login, persist the accessToken in localStorage under the key classify_access_token so that subsequent requests to protected endpoints can attach it as a Bearer token. Any 401 response anywhere in the application should clear this key and redirect the user back to /login.

Request

POST /api/auth/login
Content-Type: application/json

Body parameters

email
string
required
The email address associated with the Classify account.
password
string
required
The account password.

Response 200 OK

accessToken
string
Short-lived JWT. Include this as Authorization: Bearer <accessToken> on all requests to protected endpoints.
refreshToken
string
Long-lived token that can be used to obtain a new access token when the current one expires.
user
object
Full profile of the authenticated user.
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "v1.refresh-token-value",
  "user": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "email": "ada@example.com",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "roleId": 3,
    "roleLabel": "student",
    "profilePhotoUrl": "https://cdn.example.com/avatars/ada.jpg"
  }
}

Error responses

StatusCondition
401Email not found or password is incorrect
{ "error": "Invalid login credentials" }

Examples

curl -X POST http://localhost:3001/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "password": "s3cur3P@ss"
  }'
The Vite dev server proxies /api/* from localhost:5173 to localhost:3001, so you can use the path /api/auth/login directly in frontend code without hardcoding the backend port.

Build docs developers (and LLMs) love