feat(users): include email in /users/search response (#42) - #43
Merged
Conversation
Consumer pickers (e.g. the admin owner-grant flow in hera-streamer-invitational-2026-web) currently render a raw UUID as the fallback label when a matched user has no display_name set — common for Steam-OAuth users who haven't customized their profile. This makes the picker functionally unusable for that population. Adding email to UserSearchResult lets consumer-side code render ``display_name ?? email`` and never bottom out at the UUID. The endpoint is authenticated and the search query already matches against email as an input key, so returning email doesn't expand the caller's existing knowledge surface — they already had to know (or guess) it to find the user via email-match. email is null for Steam-OAuth users pre-tos-gate, matching the existing nullability on /auth/me's UserRead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42.
Summary
Consumer pickers (e.g. the admin owner-grant flow in hera-streamer-invitational-2026-web#142) currently render a raw UUID as the fallback label when a matched user has no `display_name` — common for Steam-OAuth users who haven't customized their profile. This makes the picker functionally unusable for that population.
Adds `email: str | None` to `UserSearchResult`. Consumer-side code can now render `display_name ?? email` and never bottom out at the UUID. `email` is null for Steam-OAuth users pre-tos-gate, matching the existing nullability on `/auth/me`'s `UserRead`.
Privacy posture
The endpoint is authenticated AND the search query already matches against email as an input key — meaning a caller who didn't already know the email couldn't have found that user via the email-substring branch anyway. Returning email doesn't expand the caller's knowledge surface. The two callers that have a legitimate reason to type-ahead users (admin picker in hera-streamer-invitational-2026-web, profile pages) both benefit; nothing else changes.
If you want a more conservative posture later (e.g. gate behind a query param or admin role), this PR keeps the field unconditional and we can add the gate as a follow-up. Per the issue's consumer recommendation, defaulting to unconditional.
Test plan
Consumer-side follow-up
After this merges, downstream consumers can regenerate their TS types and remove the raw-UUID fallback from their picker code. The relevant consumer issue is hera-streamer-invitational-2026-web#142.