User Login Flow
API Request
POST /api/auth/login
Content-Type: application/json{
"username": "admin",
"password": "password"
}API Response (Success)
HTTP/1.1 200 OK
Content-Type: application/json{
"success": true,
"status": 200,
"data": {
"userName": "admin",
"userType": "staff",
"userId": 1,
"role": "Super Admin",
"adpStatus": null,
"book_chapter_approver_designation": null,
"token": "eyJhbGciOiJIUzUxMiJ9..."
}
}Sequence Diagram
Flow Description
- Request Initiation: Client sends POST request to
/api/authenticatewith credentials. - CORS Validation: Validates request origin and headers.
- Rate Limiting: Checks request frequency per client/IP.
- Authentication Processing:
- User lookup in database.
- Password verification using BCrypt.
- JWT token generation.
- Response: Returns JWT token and user info on success, or error message on failure.
Last updated on