🔐 Authentication
Get logged in user
The API endpoint allows you to retrieve the details of the currently logged-in user based on their authentication token.
When accessing this endpoint with a valid authentication token, you will receive a response containing the information of the user who is currently authenticated and logged in.
get/users/current-user
Response
Get logged in user
Example response
{
"data": {
"_id": "649e795264e7dba29b726936",
"avatar": {
"_id": "649e795264e7dba29b726935",
"url": "https://via.placeholder.com/200x200.png"
},
"createdAt": "2023-06-30T06:42:26.163Z",
"email": "user.email@domain.com",
"loginType": "EMAIL_PASSWORD",
"role": "ADMIN",
"updatedAt": "2023-06-30T06:44:29.831Z",
"username": "doejohn"
},
"message": "Current user fetched successfully",
"statusCode": 200,
"success": true
}