admin: More granular HTTP return codes for user-related endpoints #2477

Closed
opened 2026-04-06 03:46:04 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @dongcarl on 5/9/2021

Based on: #1663

 admin: Specifically return 404 for user not found

- Modify err_code to accept an expr for err_code
- Add get_user_or_404, properly returning 404 instead of a generic 400
  for cases where user is not found
- Use get_user_or_404 where appropriate.
admin: Make invite_user error codes more specific

- Return 409 Conflict for when a user with that email already exists
- Return 500 InternalServerError for everything else
*Originally created by @dongcarl on 5/9/2021* Based on: #1663 ``` admin: Specifically return 404 for user not found - Modify err_code to accept an expr for err_code - Add get_user_or_404, properly returning 404 instead of a generic 400 for cases where user is not found - Use get_user_or_404 where appropriate. ``` ``` admin: Make invite_user error codes more specific - Return 409 Conflict for when a user with that email already exists - Return 500 InternalServerError for everything else ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#2477