Skip to content

fix(auth): compose first+last name before falling back to first_name alone#338

Open
pranavarorajmtdholdings wants to merge 1 commit into
abhi1693:masterfrom
pranavarorajmtdholdings:fix/clerk-profile-name-composition
Open

fix(auth): compose first+last name before falling back to first_name alone#338
pranavarorajmtdholdings wants to merge 1 commit into
abhi1693:masterfrom
pranavarorajmtdholdings:fix/clerk-profile-name-composition

Conversation

@pranavarorajmtdholdings
Copy link
Copy Markdown

Summary

Fixes a name-resolution bug in _extract_clerk_profile (backend/app/core/auth.py).

The previous or chain short-circuited to first_name whenever it was present, so any Clerk user with both a first and last name (but no full_name/name) was stored using only their first name. The composed-name branch underneath was effectively unreachable.

Changes

  • Reorder name resolution to: full_namename → composed first_name + last_nameusername.
  • Update tests/test_auth_claims.py::test_extract_clerk_profile_prefers_primary_email to assert the corrected "Asha Rao" (was "Asha").

Test evidence

Ran the backend suite via uv run pytest:

318 passed, 1 xfailed in 50.33s

No other regressions.


Conversation: https://app.warp.dev/conversation/172591c1-c0e9-4f48-9865-8448ed2fb5a1

Co-Authored-By: Oz oz-agent@warp.dev

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant