Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Ajith66310/task-manager-full/llms.txt

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

The authentication endpoints live under /api/auth and are routed to the user service. Three endpoints — signup, login, and reset-password — are public and do not require a token. Only GET /api/auth/me requires a valid JWT in the Authorization header.

Sign up

POST /api/auth/signup Creates a new user account and returns a JWT. New accounts are created in an unverified state; an admin must verify the account before the user can access task endpoints.

Body parameters

email
string
required
Valid email address. Must be unique — returns 409 if already registered.
password
string
required
Account password. Stored as a bcrypt hash.
name
string
required
Display name for the account. Between 2 and 50 characters.

Example

curl --request POST \
  --url http://localhost:5000/api/auth/signup \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "you@example.com",
    "password": "secure-password",
    "name": "Your Name"
  }'
{
  "success": true,
  "message": "Account created successfully",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "_id": "664a1f2e8b1c2d3e4f5a6b7c",
      "email": "you@example.com",
      "name": "Your Name",
      "isVerified": false
    }
  }
}

Log in

POST /api/auth/login Authenticates an existing user and returns a JWT.

Body parameters

email
string
required
The registered email address.
password
string
required
The account password.

Example

curl --request POST \
  --url http://localhost:5000/api/auth/login \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "you@example.com",
    "password": "secure-password"
  }'
{
  "success": true,
  "message": "Login successful",
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "_id": "664a1f2e8b1c2d3e4f5a6b7c",
      "email": "you@example.com",
      "isVerified": true
    }
  }
}

Get current user

GET /api/auth/me Returns the profile of the authenticated user. Requires a valid JWT.

Headers

Authorization
string
required
Bearer <token> — JWT obtained from login or signup.

Example

curl --request GET \
  --url http://localhost:5000/api/auth/me \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
{
  "success": true,
  "message": "User fetched successfully",
  "data": {
    "id": "664a1f2e8b1c2d3e4f5a6b7c",
    "email": "you@example.com",
    "name": "Your Name",
    "role": "user",
    "isVerified": true
  }
}

Reset password

POST /api/auth/reset-password Resets a user’s password by email. This endpoint is public — no authentication token is required.

Body parameters

email
string
required
The email address of the account to reset.
newPassword
string
required
The new password. Minimum 6 characters.
confirmPassword
string
required
Must match newPassword exactly.

Example

curl --request POST \
  --url http://localhost:5000/api/auth/reset-password \
  --header 'Content-Type: application/json' \
  --data '{
    "email": "you@example.com",
    "newPassword": "new-secure-password",
    "confirmPassword": "new-secure-password"
  }'
{
  "success": true,
  "message": "Password reset successfully"
}

Build docs developers (and LLMs) love