Repository navigation
Conversation
A password outside the server's limits otherwise comes back as Huma's length text, or as "This value is out of range." in a translated interface. Co-authored-by: Cursor <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Thanks for the pull request. Silo takes pull requests from people who have had one merged in a Silo repository, or whom a maintainer has asked for one, so this one is closed without review. That isn't a judgment of the work. If a maintainer asked you for it, they will reopen it. If the problem still matters, open an issue for it and link this pull request; a maintainer may reopen it or use the code as a reference. Feature ideas go in Discussions → Ideas. The contributing guide explains why. |
Problem
Related issue: N/A
Validation tasks: changes #1197 C1
An administrator who sets a password shorter than 8 characters, or longer than 72 bytes, hears about it only after Create User has sent the request. The dialog then shows Huma's "expected length >= 8". In a translated interface that refusal becomes "This value is out of range." The dialog should name the limit, in the words the other password forms already use, and not send the request.
Approach
Create User checks the password with
newPasswordLengthProblembefore calling create. Sign-up and set-password already use that helper, and its messages are translated ("Use at least 8 characters.", "Use no more than 72 bytes."). A password outside those limits selects the Account tab and shows the reason above the form. A refusal that still comes from the server, such as a duplicate username, is unchanged.This is the part of #2442 that is not already on main. The dialog now lives in
CreateUserForm.tsx. This is the web admin dialog only. The API, jellycompat, and the Apple and Android clients are unaffected.Validation
The users admin page tests passed (22). They create an account with a long password, so they do not cover this refusal. A 4-character password in that same harness shows "Use at least 8 characters.", selects the Account tab, and does not call create. The full pre-PR gate was not run.
Evidence
Web admin, Create User. The alert is the line already shown above the tabs, so phone width uses the same text.
Before, on current main, a 4-character password is sent and the dialog shows "expected length >= 8", or "This value is out of range." when the interface is translated. After, Save does not send the request and shows "Use at least 8 characters." A password over 72 bytes shows "Use no more than 72 bytes."
Captures are not attached. Opening the dialog required a sign-in, and this session had no account.
Risks
None identified.
Checklist
AI Disclosure
Made with Cursor
Note
Check new user's password length before saving in
CreateUserFormAdds a
newPasswordLengthProblemcheck to the admin user-creation form in CreateUserForm.tsx. On failure, the form switches to the account tab, shows the problem as the error, and stops submission. The check runs after email validation and before invalid-limit-draft handling.Macroscope summarized 4d74d26.