full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

🐛 Handle non-existing user IDs in `read_user_by_id`

Open saltie2193 opened this issue 1 year ago • 2 comments

Fix an issue where read_user_by_id would fail to return if the requested user ID did not exist.

  • Return 404 - Not Found when ID does not exist.
  • Request without sufficient permission will always result in 403 - Unauthorized.
  • Add tests to test requesting non-existing user IDs as superuser and normal user.

saltie2193 avatar Oct 12 '24 18:10 saltie2193