Skip to content

fix(user): reject blank usernames in admin user management - #1294

Open
fei33fei wants to merge 1 commit into
blinkospace:mainfrom
fei33fei:codex/fix-admin-username-validation
Open

fei33fei wants to merge 1 commit into
blinkospace:mainfrom
fei33fei:codex/fix-admin-username-validation

Conversation

@fei33fei

Copy link
Copy Markdown

Admins can currently create an account without a username, leaving its name and default nickname blank. Reject missing or whitespace-only usernames on creation and explicitly blank usernames on updates, while preserving password-only and nickname-only updates that omit the username.

Mark the username field as required in the admin dialog, disable Save for blank input, and guard the mutation before sending it. Add regression tests covering rejected input without writes, successful creation, and partial updates.

Fixes #1213.

Validation

  • bun test server/__tests__/unit/routerTrpc/user.upsertByAdmin.test.ts — 9 passed.
  • bun test server/__tests__/security/authorization.test.ts — 24 passed.
  • git diff --check — passed.
  • Full backend type checking was not completed locally.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

添加用户时,未限制用户名必填 || When adding a user, the username is not restricted and is required.

1 participant