Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Daniel-Stojanovski/finkiopendesk/llms.txt

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

After you have created your account — either as a student via email activation or as a general user via direct registration — you use POST /auth/login to obtain a JWT. That JWT goes into the Authorization: Bearer header of every call to a protected endpoint. This page walks through the login flow, shows how to wire up the token in both frontend and backend code, and covers the authenticated user-profile endpoints.

Log in

1

Call POST /auth/login

Send your email and password as JSON.
curl -X POST \
  https://finkiopendesk-be.onrender.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@example.com",
    "password": "YourPassword1!"
  }'
Request body:
FieldTypeDescription
emailstringThe email address you registered with
passwordstringYour account password
2

Receive the JWT

A successful login returns 200 OK. The response body is the raw JWT string:
eyJhbGciOiJIUzI1NiJ9...
This token is valid for 24 hours. After it expires, call POST /auth/login again to get a fresh one.
3

Store and use the token

Include the token in the Authorization header of every request to a protected endpoint:
Authorization: Bearer <your_token>
See the Using the token section below for frontend and curl examples.
You cannot log in with a student account that has not been activated yet. Complete the email activation flow first — see Register as a student.

Using the token

Pass the token in the Authorization header on every protected request:
# Retrieve the authenticated user's profile
curl https://finkiopendesk-be.onrender.com/auth/user \
  -H "Authorization: Bearer <your_token>"

# Assign an academic program
curl -X POST \
  https://finkiopendesk-be.onrender.com/auth/user/program/CS \
  -H "Authorization: Bearer <your_token>"

# Remove the assigned program
curl -X DELETE \
  https://finkiopendesk-be.onrender.com/auth/user/program \
  -H "Authorization: Bearer <your_token>"

User-profile endpoints

All three endpoints below require a valid Authorization: Bearer <token> header.

GET /auth/user

Returns the profile of the currently authenticated user.
curl https://finkiopendesk-be.onrender.com/auth/user \
  -H "Authorization: Bearer <your_token>"
Response — example:
{
  "userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "email": "you@example.com",
  "student": true,
  "enabled": true,
  "selectedProgram": null
}

POST /auth/user/program/

Assigns an academic program to your account. The programId path parameter is the identifier of the program you want to select.
curl -X POST \
  https://finkiopendesk-be.onrender.com/auth/user/program/CS \
  -H "Authorization: Bearer <your_token>"
Returns 200 OK with an empty body on success.

DELETE /auth/user/program

Removes the currently assigned academic program from your account.
curl -X DELETE \
  https://finkiopendesk-be.onrender.com/auth/user/program \
  -H "Authorization: Bearer <your_token>"
Returns 200 OK with an empty body on success.

Token reference

PropertyValue
AlgorithmHS256
Lifetime24 hours
Subject claim (sub)User UUID
Additional claimsemail, student (boolean)
TransportAuthorization: Bearer <token> header
The FinkiOpenDesk frontend stores the JWT in localStorage under the key "token". If you are building a client application, this is a straightforward place to persist it, but consider your application’s security requirements before doing the same.

Error reference

ScenarioHTTP status
Missing or invalid token401 Unauthorized
Expired token401 Unauthorized
Wrong email or password500 (invalid credentials)
Account not activated (student)500 (user not activated)

Build docs developers (and LLMs) love