TaskFlow uses a two-role model —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.
user and admin — to control what actions each account can perform. New user accounts are unverified by default and must be approved by an admin before they can create tasks. This page explains the account lifecycle, verification requirements, and password management.
User model fields
| Field | Type | Constraints | Default |
|---|---|---|---|
name | string | Required. 2–50 characters. | — |
email | string | Required. Unique, stored in lowercase. | — |
password | string | Required. Minimum 6 characters. Never returned in API responses. | — |
role | string | admin or user. | user |
isVerified | boolean | Whether the account has been verified by an admin. | false |
Roles
user (default)
Standard accounts created through the public signup endpoint. Users can:
- Create, update, and delete their own tasks (once verified).
- View and filter their own task list.
- Update their password via the reset endpoint.
admin
Admin accounts have elevated access. Admins can:
- View and manage tasks across all users.
- Verify and delete user accounts.
- Assign tasks directly to users.
- Review and verify tasks pending admin approval.
- Mark tasks as completed.
Signup and the default admin
All accounts are created viaPOST /api/auth/signup:
ADMIN_EMAIL environment variable. If it matches, the new account is granted role: admin and isVerified: true automatically, bypassing the manual verification step. All other emails receive role: user and isVerified: false.
Account verification workflow
Unverified users cannot create tasks. The
checkVerified middleware blocks all task-creation requests with 403 Forbidden until an admin verifies the account.User signs up
The user registers via
POST /api/auth/signup. Their account is created with isVerified: false.Admin reviews the account
An admin opens the User Management page in the Admin Dashboard (port 3000) or calls
GET /api/admin/users to list unverified users.Admin verifies the user
The admin calls
PATCH /api/admin/users/:id/verify. The user’s isVerified field is set to true.Password reset
TaskFlow provides a simple reset endpoint. No email token is required — provide the account’s email along with the new password:email,newPassword, andconfirmPasswordare all required.newPasswordandconfirmPasswordmust match.- The new password must be at least 6 characters.
Login
JWT_EXPIRES_IN environment variable) along with the user’s id, name, email, role, and isVerified status. Pass this token as Authorization: Bearer <token> on all protected endpoints.