Skip to content

station-signup: display_username loses the caller's casing, unlike better-auth's own sign-up #2379

Description

@jakebromberg

Behavior delta to decide on

POST /auth/wxyc/station-signup normalizes the username to lowercase at the top of the handler (correctly — better-auth's username plugin lowercases on store and duplicate-checks the lowercased value, and the raw-case pre-check was a burned-use 500 bug). But provisionUser passes that normalized value to internalAdapter.createUser, and better-auth's create hook sets display_username from whatever it is handed. So a DJ signing up as DJ_Awesome gets display_username = 'dj_awesome', whereas better-auth's own /sign-up/email preserves the caller's casing in display_username while lowercasing username.

Purely cosmetic, but it is a real delta from both better-auth's native behavior and this endpoint's first revision.

The question

Does display casing matter anywhere dj-site shows a username? If yes, the fix is small: thread the raw (pre-normalization) value through provisionUser as an explicit displayUsername so login stays case-insensitive while display preserves what the DJ typed. If no, close this and the lowercased display name is the documented behavior.

Related

Fallout noted in the #2375 review. dj-site#1352 (the signup form) is the surface where the answer shows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions