Ory elements registration form sets all fields as required
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- next.js, react, typescript
调研方向
从 Registration component 开始,检查 ui.nodes 属性如何转换为必填表单字段,使用仅要求 email 而 traits.phone 可选的示例。验证 registration UI 允许在不填写电话号码的情况下提交,同时仍要求填写 email。
由索引模型根据 Issue 内容生成。
描述
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
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:
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
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ory/elements 的其他 Issue
-
Needs Triage
难度 2/5 1-3 小时 新手友好度 70/100
-
good first issue help wanted upstream
难度 2/5 1-3 小时 新手友好度 45/100
-
good first issue help wanted upstream
难度 3/5 1-2 天 新手友好度 25/100
-
Needs Triage
难度 3/5 1-2 天 新手友好度 52/100
-
bug
难度 4/5 3-5 天 新手友好度 45/100
相似的 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 88/100
StabilityNexus/Fate-EVM-Frontend#153 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
code-yeongyu/oh-my-openagent#9039 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
Tencent/teamai-cli#862 ·
维护者通常 1 天内回复
-
bug good first issue hacktoberfest redis
难度 2/5 1-3 小时 新手友好度 88/100
libredb/libredb-studio#1164 ·
维护者通常 1 天内回复
-
flake
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复