fix(ui): allow uppercase letters in username on profile settings - #1572
fix(ui): allow uppercase letters in username on profile settings#1572culfin 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>
|
@culfin Thanks for the fix — approved. One process note: please retarget this PR to |
|
Retargeted to While doing that I also consolidated: what were fourteen open pull requests are now seven. Four defects in |
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.