Repository navigation
feat: carry preferred_username as the user's username - #5
Merged
Merged
Conversation
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
force-pushed
the
feat/username-3.6
branch
from
October 21, 2026 17:29
d21f3c5 to
1e2a42f
Compare
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.
Expose Keycloak's
preferred_usernameas the optionaluser.usernamefield 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: falsefields from OAuth profile writes. Keep the field server-owned by carrying the verified profile through request-scoped validation and user-write hooks, withoverrideUserInfoenabled.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.