Dashboard Login API (Super Admin Restricted)
Overview
Restricted authentication endpoint specifically for Admin Panel Dashboard access. Strictly permits users with the SUPER_ADMIN role, rejecting non-superadmin accounts with 403 Forbidden.
- Endpoint:
/api/auth/dashboard-login - Method:
POST - Access: Super Admin Only
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
email | String | Yes | Super admin email address |
password | String | Yes | Account password |
Request Body Example
{
"email": "admin@routeledgers.com",
"password": "SuperSecretPassword123!"
}
Success Response (200 OK)
{
"success": true,
"message": "Dashboard login successful",
"data": {
"user": {
"id": "u0001-superadmin-uuid",
"email": "admin@routeledgers.com",
"firstName": "Super",
"lastName": "Admin"
},
"roles": [
"SUPER_ADMIN"
],
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
Error Response (403 Forbidden - Non-Superadmin Attempt)
{
"success": false,
"message": "Access denied: Dashboard access is restricted to Super Admin users",
"data": null
}
Database Impact
- Tables:
users,user_role_maps,roles - Operations:
SELECTuser details, verifySUPER_ADMINrole membership,UPDATElastLoginAt.