♻️ Return entire user object

The Model.Schema already prevents password_hash from leaking
This commit is contained in:
Brian Wiborg 2025-09-27 16:15:50 +02:00
parent b5b005448a
commit 92bb1cc648
No known key found for this signature in database

View file

@ -160,11 +160,5 @@ async def introspect(token: Dict = Depends(get_token)):
@router.get("/me") @router.get("/me")
async def me(user: User = Depends(get_current_user)): async def me(user: User = Depends(get_current_user)):
"""Return the currently authenticated user.""" """Return the currently authenticated user."""
return { return user
"email": user.email,
"username": user.username,
"is_admin": user.is_admin,
"is_staff": user.is_staff,
}