Skip to content

feat: carry preferred_username as the user's username - #5

Merged
brammitch merged 2 commits into
mainfrom
feat/username-3.6
Oct 21, 2026
Merged

brammitch merged 2 commits into
mainfrom
feat/username-3.6

Conversation

@brammitch

Copy link
Copy Markdown
Collaborator

Expose Keycloak's preferred_username as the optional user.username field without changing display-name fallback behavior. Better Auth's migrator adds the column; existing users receive it on their next login.

Better Auth 1.7.7 also strips input: false fields from OAuth profile writes. Keep the field server-owned by carrying the verified profile through request-scoped validation and user-write hooks, with overrideUserInfo enabled.

Validation: all 325 core tests pass, including sanitized get-session and existing-user login coverage; lint and build pass. The local Compose migrator added only user.username, and Ann's certificate login exposed the username in get-session. Adds a minor changeset; intended to release with the React entry as 0.2.0.

Part of Interlock work item 3.6. No release or consumer bump is included here.

@brammitch
brammitch added this pull request to stack #7 October 21, 2026 15:38
Keep username server-owned while carrying verified Keycloak profile fields
through Better Auth's validation and database hooks. Existing users receive
the field on their next login after the host runs the Better Auth migrator.
@brammitch
brammitch merged commit 324e1de into main Oct 21, 2026
3 checks passed
@brammitch
brammitch deleted the feat/username-3.6 branch October 21, 2026 17:32
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