Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ory elements registration form sets all fields as required

オープン
#574 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
next.js, react, typescript

調査の方向性

Registration コンポーネントから始め、ui.nodes 属性が必須フォームフィールドに変換される仕組みを、email のみが必須で traits.phone が任意である例を使って確認します。登録 UI で電話番号なしでも送信でき、なおかつ email は必須のままであることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
187
フォーク
80
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ory/elements のほかの issue

ory/elements の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。