Skip to content

fix(web): check a new user's password length before saving - #4076

Closed
memnos wants to merge 1 commit into
Silo-Server:mainfrom
memnos:fix/admin-create-user-password-length
Closed

memnos wants to merge 1 commit into
Silo-Server:mainfrom
memnos:fix/admin-create-user-password-length

Conversation

@memnos

@memnos memnos commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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 newPasswordLengthProblem before 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

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Cursor
  • Tool(s): Cursor agent
  • Model(s): Grok 4.7
  • Involvement: AI-assisted
  • Adversarial review: n/a

Made with Cursor

Note

Check new user's password length before saving in CreateUserForm

Adds a newPasswordLengthProblem check 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.

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-triage silo-triage Bot added the size/S 0–49 added + deleted lines (all files); change volume, not priority. label Nov 13, 2026
@silo-kody

silo-kody Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌
⚠️ 5 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility
  • Retain distributed firing claims through their own validity windows

@github-actions

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot closed this Nov 13, 2026
@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Labels

size/S 0–49 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant