cURL
curl --request POST \ --url http://localhost:3000/api/auth/login \ --header 'Content-Type: application/json' \ --data ' { "username": "<string>", "password": "<string>" } '
{ "success": true, "message": "<string>", "data": { "token": "<string>", "worker": { "_id": "<string>", "name": "<string>", "username": "<string>", "position": "<string>", "role": "<string>", "notificationPreferences": { "enabled": true, "volume": 0.6, "sounds": { "low": "soft_pop", "medium": "ding", "high": "alert", "urgent": "alert" } }, "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z" } } }
1
Login successful. The worker object includes a populated role (full role document with permissions, not only an id).
worker
role
permissions
true
Show child attributes