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

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

Đang mở
#606 0 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
72/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
authentication, frontend

Hướng nghiên cứu

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.

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

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
188
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.