Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Ory elements registration form sets all fields as required

Đang mở
#574 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
authentication, frontend

Hướng nghiên cứu

Bắt đầu từ component Registration và kiểm tra cách các thuộc tính ui.nodes được chuyển đổi thành các trường biểu mẫu bắt buộc, sử dụng ví dụ trong đó chỉ email là bắt buộc còn traits.phone là tùy chọn. Xác minh rằng registration UI cho phép gửi biểu mẫu mà không cần số điện thoại nhưng vẫn yêu cầu email.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Preflight checklist
Ory Network Project

No response

Describe the bug

When rendering the UI of a registration form, the optional fields are treated as required. In our case this is phone number — it is not a required field to register, however, users are not able to register without filling in the field.

The ui.nodes response :

{
    "attributes": {
        "autocomplete": "tel",
        "disabled": false,
        "name": "traits.phone",
        "node_type": "input",
        "type": "tel"
    },
    "group": "default",
    "messages": [],
    "meta": {
        "label": {
            "context": {
                "title": "Phone Number"
            },
            "id": 1070002,
            "text": "Phone Number",
            "type": "info"
        }
    },
    "type": "input"
}

And our identity schema only requires email as a required trait:

"required": [
    "email"
],

The resulting UI treats traits.phone filed as required:

Image
Reproducing the bug

We run our self-hosted Next.js app with all authentication pages.

The code for the registration page is the following:

<Registration
          flow={flow}
          config={config}
/>

The config is like this:

export const config: OryClientConfiguration = {
  intl: {
    locale: 'en', 
    customTranslations: {
      en: {
        'identities.messages.1040001': 'Continue ⮕',
      },
    },
  },
  project: {
    default_locale: 'en',
    default_redirect_url: process.env.REDIRECT_URL ?? '/',
    error_ui_url: '/error',
    locale_behavior: 'force_default',
    name: 'App',
    registration_enabled: true,
    verification_enabled: true,
    recovery_enabled: true,
    registration_ui_url: '/auth/registration',
    verification_ui_url: '/auth/verification,
    recovery_ui_url: '/auth/recovery,
    login_ui_url: '/auth/login,
    settings_ui_url: '/auth/settings,
  },
}
Relevant log output

Relevant configuration

Version

^1.1.0

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

Ngôn ngữ chính
TypeScript
Star
187
Fork
80
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ory/elements

Tất cả issue của ory/elements

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.