Skip to content

console: a refused self-registration shows the server's raw English message — RegisterPage maps only USER_ALREADY_EXISTS to localized text #10998

Description

@objectstack-fleet

Symptom

On a zh-CN console, submitting /_console/register with an uninvited email on a stock boot (audience posture invite_only) shows this verbatim under the Chinese form:

Self-registration is closed on this environment (audience posture invite_only). Ask an administrator for an invitation.

The text is English and exposes the internal term "audience posture invite_only" to an end user.

Mechanism

The server answers 403 with a stable code, {"code":"SELF_REGISTRATION_CLOSED", ...}. The same door can also answer EMAIL_DOMAIN_NOT_ALLOWED under the email_domain posture.

apps/console/src/pages/auth/RegisterPage.tsx passes an error-code map to the form that localizes only USER_ALREADY_EXISTS and USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL (auth.register.errors.userExists). Every other code falls through to the server's message.

Reproduction

  1. Boot a stock objectstack showcase with an owner already created (objectui pin dd3f7e1be356).
  2. Open /_console/register signed out, with the console locale zh.
  3. Register someone@example.com, a new email with no invitation.
  4. The refusal renders the English server message above.

Expected

SELF_REGISTRATION_CLOSED and EMAIL_DOMAIN_NOT_ALLOWED map to localized, end-user wording, for example 「本环境未开放自助注册,请联系管理员获取邀请」. The raw server message is reserved for codes the page does not know.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seati18npriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions