pub async fn get_current_user(
__arg0: Extension<FilteredUser>,
) -> Result<impl IntoResponse, (StatusCode, Json<Value>)>Expand description
Retrieves the currently authenticated user’s information.
Uses the FilteredUser data embedded in the JWT token (via middleware).
Useful for frontends to display logged-in user info or verify authentication.
§Returns
200 OKwithFilteredUserdata (excluding password)- Automatically returns
401 Unauthorizedif not authenticated (middleware)
§Example Response
{
"status": "success",
"data": {
"id": 1,
"first_name": "Admin",
"last_name": "User",
"is_admin": true
}
}