Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate registration nodes #3724

Closed
5 tasks done
hperl opened this issue Jan 31, 2024 · 1 comment
Closed
5 tasks done

Deduplicate registration nodes #3724

hperl opened this issue Jan 31, 2024 · 1 comment
Assignees
Labels
feat New feature or request.

Comments

@hperl
Copy link
Contributor

hperl commented Jan 31, 2024

Preflight checklist

Ory Network Project

No response

Describe your problem

Nodes from the traits are duplicated if multiple login strategies exist. Screenshot:

localhost_4455_registration_flow=ea723c14-2c3a-41ff-ade3-f765b83d85dd

Describe your ideal solution

User-facing

Registration will happen in two user-visible steps:

  1. User is prompted for the traits (email, name, whatever is configured). Traits are submitted and validated.
  2. User is prompted to give a credential. For example:
    • Password: Password input and submit button
    • Passkey: “Create Passkey” button
    • Code: “Send one-time code” button

Software design

We achieve the above through a new “traitsonly” strategy which just renders the default nodes and a button to submit them. On submission, the strategy will write the traits to the flow (internalcontext), and then set the UI nodes to what the other strategies return (except for the default nodes, which were already covered).

A PreRegistrationHook will be used to remove the nodes of the other strategies (like the password field) store them into the internal context of the flow to retrieve once the traits have been submitted.

Selecting the credential is then covered by rendering the nodes of the individual strategies. Some schemas probably need to be adapted to cover the case where the traits have been pre-submitted.

The pre-submitted traits can either be queried in the concrete strategy by reading from the internal context, or injected back into the updateRegistration request form in updateRegistrationFlow (which will simulate a one-step registration to the concrete strategy). Not sure 🤷.

Workarounds or alternatives

  • Leave it as is.
  • Have a JS tab bar on top for which you select the credential strategy you want. For example, with password and passkey enabled, you have a tab bar with “password” and “passkey” up top, and selecting each tab will yield the form for this strategy. This can be done purely in the hosted UI with JS, falling back to how it looks right now.

Version

master

Additional Context

No response

@hperl hperl added the feat New feature or request. label Jan 31, 2024
@hperl hperl self-assigned this Jan 31, 2024
@hperl hperl linked a pull request Feb 7, 2024 that will close this issue
7 tasks
@aeneasr
Copy link
Member

aeneasr commented Sep 19, 2024

This is don ewith two-step registration.

@aeneasr aeneasr closed this as completed Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants