Skip to content

fix(auth)+feat(cli): Create User dialog — translatable action params (#3030) and explicit-password-wins semantics (#3031)#3033

Merged
os-zhuang merged 2 commits into
mainfrom
claude/user-creation-i18n-0646bc
Jul 16, 2026
Merged

fix(auth)+feat(cli): Create User dialog — translatable action params (#3030) and explicit-password-wins semantics (#3031)#3033
os-zhuang merged 2 commits into
mainfrom
claude/user-creation-i18n-0646bc

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Closes #3030, closes #3031.

Two fixes for the Setup app Create User flow (and every other action param dialog), split into one commit each:

1. feat(cli): extract action param i18n keys + fill translations (#3030)

os i18n extract never walked actions[].params, so the o.<object>._actions.<action>.params.* keys the console client already resolves were absent from generated bundles — the dialog rendered raw English under zh-CN/ja-JP/es-ES.

  • collectExpectedEntries (packages/cli/src/utils/i18n-extract.ts) now emits inline-param label / helpText / placeholder / options.<value> — for object actions and top-level actions. Field-backed params ({ field: '…' }) are skipped unless they carry a literal override, since field translations cover them at runtime.
  • Regenerated the 8 platform-objects bundles (en/zh-CN/ja-JP/es-ES × objects/metadata-forms) and filled the ~26 new key groups per locale (user admin actions, sys_jwks alg/curve fields, page variables.* form keys). A second --merge pass is idempotent (zero diff).
  • Changeset: @objectstack/cli minor, @objectstack/platform-objects patch.

Verified in the showcase: with zh-CN active the Create User dialog renders fully in Chinese.

2. fix(auth): explicit password overrides generatePassword (#3031)

The dialog defaults generatePassword: true and labels the password input "Password (leave empty to generate)" — so typing a password sent both flags and the endpoint 400'd ("Provide either password or generatePassword, not both"): the most natural flow always failed. The param visible CEL scope can't reference other params' live values, so this can't be fixed client-side.

resolvePassword (packages/plugins/plugin-auth/src/admin-user-endpoints.ts) now treats an explicit non-empty password as an unambiguous override:

  • explicit password → used (complexity-checked as before), temporaryPassword not returned;
  • empty/absent password + generatePassword: true → temporary password generated (unchanged);
  • neither → 400 (unchanged).

Applies to both create-user and set-password (newPassword). Backward compatible — the only change is that a previously-rejected request now succeeds with the intent the label promised. Pure bug fix, no changeset.

Testing

  • plugin-auth unit tests: 32/32 (new: explicit-password-wins, empty-password-still-generates).
  • cli i18n-extract tests extended for param extraction (inline vs field-backed, global actions).
  • Live-verified on the showcase: the exact previously-failing request body now returns 200; the created user signs in with the explicit password; response carries no temporaryPassword.

Related client-side crash on this 400 (error envelope → toast.error → React #31) is fixed separately in objectstack-ai/objectui#2579.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Error Error Jul 16, 2026 8:10am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/l labels Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/platform-objects, @objectstack/plugin-auth.

23 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/cli)
  • content/docs/api/client-sdk.mdx (via @objectstack/cli)
  • content/docs/api/data-flow.mdx (via @objectstack/cli)
  • content/docs/api/environment-routing.mdx (via @objectstack/cli)
  • content/docs/api/error-catalog.mdx (via @objectstack/cli)
  • content/docs/automation/hook-bodies.mdx (via packages/cli)
  • content/docs/deployment/backup-restore.mdx (via @objectstack/cli)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/plugin-auth)
  • content/docs/deployment/self-hosting.mdx (via @objectstack/cli)
  • content/docs/getting-started/cli.mdx (via @objectstack/cli, @objectstack/plugin-auth)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/cli)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/cli)
  • content/docs/kernel/runtime-services/index.mdx (via packages/cli)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/plugin-auth)
  • content/docs/permissions/authentication.mdx (via @objectstack/cli, @objectstack/plugin-auth)
  • content/docs/permissions/sso.mdx (via @objectstack/plugin-auth)
  • content/docs/plugins/index.mdx (via @objectstack/plugin-auth)
  • content/docs/plugins/packages.mdx (via @objectstack/cli, @objectstack/platform-objects, @objectstack/plugin-auth)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/cli)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/cli)
  • content/docs/releases/implementation-status.mdx (via @objectstack/cli, @objectstack/plugin-auth)
  • content/docs/releases/v9.mdx (via @objectstack/plugin-auth)
  • content/docs/ui/setup-app.mdx (via @objectstack/platform-objects)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

…nslations (#3030)

`os i18n extract` never walked `actions[].params`, so the
`o.<object>._actions.<action>.params.*` keys the console client already
resolves were absent from generated bundles — action dialogs (Setup →
Create User, Set Password, Ban…) rendered raw English under any locale.

- collectExpectedEntries now emits inline-param label/helpText/placeholder/
  options (field-backed params only when they carry a literal override),
  for object actions and top-level actions alike.
- Regenerate the en/zh-CN/ja-JP/es-ES bundles in platform-objects and fill
  the new key groups; a second `--merge` pass is idempotent.
…r/set-password (#3031)

The console Create User dialog defaults `generatePassword: true` and labels
the password input "leave empty to generate" — so typing a password sent
both and the endpoint 400'd ("Provide either password or generatePassword,
not both"), making the most natural flow always fail. The param `visible`
CEL can't see other params' live values, so the dialog can't uncheck the
box client-side.

resolvePassword now treats an explicit non-empty password as an unambiguous
override: use it (complexity-checked, no temporaryPassword in the response);
generate only when the password is empty and generatePassword is true.
Applies to create-user and set-password alike.
@os-zhuang os-zhuang merged commit eb89a8c into main Jul 16, 2026
15 of 16 checks passed
@os-zhuang os-zhuang deleted the claude/user-creation-i18n-0646bc branch July 16, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling

Projects

None yet

2 participants