Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndresLopezCorrales/Goods-Inventory/llms.txt

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

The login endpoint authenticates admin users by checking the admin table. On success it returns a short-lived JWT access token that must be included in all subsequent admin API calls.

Request

  • Method: POST
  • Path: /api/login
  • Auth: None
  • Content-Type: application/json

Body Parameters

name
string
required
Admin username stored in the admin table.
password
string
required
Admin password. Validated server-side against the stored credential.

Request Example

curl -X POST http://localhost:5000/api/login \
  -H "Content-Type: application/json" \
  -d '{"name": "admin", "password": "yourpassword"}'

Response

200 — Success

{
  "message": "Login successful",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
message
string
Human-readable confirmation string. Value is always "Login successful" on a 200 response.
access_token
string
Signed JWT access token. Include this value in the Authorization header of every subsequent admin API request.

401 — Invalid Credentials

{ "error": "Invalid credentials" }

Token Usage

Pass the token as a Bearer token in the Authorization header for all admin endpoints:
Authorization: Bearer <access_token>
Token lifetime is controlled by the JWT_EXPIRES_DAYS environment variable in the server .env file. The default lifetime is 1 day. After expiry, the client must re-authenticate via this endpoint to obtain a new token.

Build docs developers (and LLMs) love