fix(auth): compose first+last name before falling back to first_name alone#338
Open
pranavarorajmtdholdings wants to merge 1 commit into
Conversation
…alone _extract_clerk_profile previously short-circuited the name resolution to 'first_name' whenever it was present, so users with both a first and last name were stored using only their first name. Reorder the resolution to prefer full_name/name, then compose first+last, then fall back to username last. Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Summary
Fixes a name-resolution bug in
_extract_clerk_profile(backend/app/core/auth.py).The previous
orchain short-circuited tofirst_namewhenever it was present, so any Clerk user with both a first and last name (but nofull_name/name) was stored using only their first name. The composed-name branch underneath was effectively unreachable.Changes
full_name→name→ composedfirst_name + last_name→username.tests/test_auth_claims.py::test_extract_clerk_profile_prefers_primary_emailto assert the corrected "Asha Rao" (was "Asha").Test evidence
Ran the backend suite via
uv run pytest:No other regressions.
Conversation: https://app.warp.dev/conversation/172591c1-c0e9-4f48-9865-8448ed2fb5a1
Co-Authored-By: Oz oz-agent@warp.dev