Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Prefill the recovery email from the login identifier on "Forgot password?"

未关闭
#606 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
react, typescript

调研方向

Start with packages/elements-react/src/theme/default/components/form/label.tsx and packages/elements-react/src/components/form/form-helpers.ts, as linked in the issue. Trace how the hidden identifier node is used on the password step and how recovery fields are prefilled; check that only email identifiers are passed as login_hint. Done when recovery prefills the appropriate email field, including recovery_address when enabled, without passing usernames or phone numbers.

由索引模型根据 Issue 内容生成。

描述

enhancement
Preflight checklist
Ory Network Project

No response

Describe your problem

In the two-step login form, the user enters their email, clicks continue, and lands on the password step. If they then click "Forgot password?", Elements opens a new recovery flow without the email, so the user has to type it again.

Requested by an Ory Network customer.

Describe your ideal solution
  1. LabelAction adds login_hint=<identifier> to the "Forgot password?" link. On the password step the identifier is in the hidden identifier node.
  2. The login_hint prefill in form-helpers.ts also covers recovery flows. Today prefillIdentifierFields only lists identifier and traits.email. Recovery uses email, or recovery_address when the choose-recovery-address feature is on.

Only pass the hint when the identifier is an email address, since the login identifier can also be a username or phone number.

Workarounds or alternatives

Users can build this today:

  • Override components.Node.Label to add login_hint to the link. This means taking over label rendering for the whole form.
  • On the recovery page, read login_hint from flow.request_url and set the email / recovery_address node value before passing the flow to <Recovery>.

This puts the email in the URL, so it ends up in browser history and request logs. Passing it through sessionStorage avoids that, since login and recovery are on the same origin. The built-in version could be opt-in for the same reason.

Version

@ory/elements-react 1.2.1 and 1.3.0-rc.0

Additional Context

No Kratos change is needed. Kratos keeps extra query params on the recovery init URL: /self-service/recovery/[email protected] comes back unchanged in the flow's request_url.

主要语言
TypeScript
星标
187
派生
80
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ory/elements 的其他 Issue

查看 ory/elements 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。