fix(ui): allow uppercase letters in username on profile settings - #1572
Open
culfin wants to merge 1 commit into
Open
fix(ui): allow uppercase letters in username on profile settings#1572culfin wants to merge 1 commit into
culfin wants to merge 1 commit into
Conversation
The username check in profile settings is the only one that rejects
uppercase letters. Registration, installation and the server all accept
them:
ui/src/pages/Users/Register/components/SignUpForm/index.tsx
/^[\w.-\s]{2,30}$/ uppercase allowed
ui/src/pages/Install/components/FourthStep/index.tsx
/^[\w.-\s]{2,30}$/ uppercase allowed
pkg/checker/username.go
^[\w.\- ]{2,30}$ uppercase allowed
ui/src/pages/Users/Settings/Profile/index.tsx
/[^a-z0-9\-._]/ uppercase rejected
A user who signs up as "MaxMustermann" can therefore never save their
profile, not even when leaving the username untouched, because the whole
form is validated on submit. The error message points at the username
field without explaining why a name the server issued is now invalid.
Adding the ignore-case flag brings this check in line with the other
three. It permits nothing the server would reject.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Users whose username contains an uppercase letter cannot save their profile at all — not even when they leave the username untouched, because the whole form is validated on submit.
The check in profile settings is the only one of four that rejects uppercase:
ui/src/pages/Users/Register/components/SignUpForm/index.tsx/^[\w.-\s]{2,30}$/ui/src/pages/Install/components/FourthStep/index.tsx/^[\w.-\s]{2,30}$/pkg/checker/username.go^[\w.\- ]{2,30}$ui/src/pages/Users/Settings/Profile/index.tsx/[^a-z0-9\-._]/So one can sign up as
MaxMustermann, and from then on the profile page is locked. The error message points at the username field without saying why a name the server itself issued is suddenly invalid.I ran into this migrating a 26-year-old forum to Answer: 3368 of 5479 accounts carry uppercase letters in names that have been in use for two decades.
Proposed Changes
An alternative would be to reuse the exact pattern from
SignUpForm, but that also allows spaces, which felt like a larger change than this fix needs. Happy to switch if you prefer the patterns to be literally identical.