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 /me endpoint resolves the JWT supplied in the Authorization header and returns the full profile of the corresponding user. It is the canonical way to rehydrate a session — for example, on application load you can call this endpoint with the token stored in localStorage.classify_access_token to confirm the token is still valid and populate the authenticated user state. If the token is missing, malformed, or expired, the endpoint returns 401 and the client should clear the stored token and redirect to /login.

Request

GET /api/auth/me

Headers

Authorization
string
required
Must be in the format Bearer <accessToken>. Obtain the access token from the login or register endpoints and persist it in localStorage as classify_access_token.

Response 200 OK

user
object
Full profile of the authenticated user.
{
  "user": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "email": "ada@example.com",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "roleId": 3,
    "roleLabel": "student",
    "profilePhotoUrl": null
  }
}

Error responses

StatusCondition
401Authorization header is absent, the token is malformed, or the token has expired
{ "error": "Unauthorized" }
On receiving a 401, the client should clear the stored token and redirect to /login:
localStorage.removeItem("classify_access_token");
window.location.href = "/login";

Examples

curl -X GET http://localhost:3001/api/auth/me \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Call GET /api/auth/me on application startup to validate a stored token before making any other authenticated requests. If the call succeeds you can trust the token is still valid and hydrate your user state from the response.

Build docs developers (and LLMs) love