ory / ory/network

Ory Account Experience (hosted UI) registration trait setup via creation of registration flow

Open
#442 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat
Dominant language
Shell
Stars
96
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Ory Network Project

No response

Describe your problem

Issue: Unable to send Identity Traits values when creating a registration flow

I am using Ory’s Account Experience ( hosted UI )
I have newsletter optin: bool ( default to true) in my Identity schema
Upon registration flow creation, I want to check from CloudFlare Header is country is IN LIST, and IF YES, then I want the newsletter optin: false
I tried sending this data with the registration flow in creation ,but none of the solution below worked.

/self-service/registration/browser?newsletter=false
/self-service/registration/browser?traits.newsletter=false
/self-service/registration/browser?prefill.newsletter=no
/self-service/registration/browser?traits={newsletter:false}
Describe your ideal solution

Ideal Solution

Just the way we can send return_to param via user registration flow creation query, we should be possible to send some default/desired trait values. Ideally ability for our app to send certain data during the flow generation via url that currently we handle via API.

This applies to all flows

  • registration
  • login
  • etc....

This is what currently works
/self-service/registration/browser?return_to="xyz.com/x/y

This is what would be REALLY nice to have
/self-service/registration/browser?return_to="xyz.com/x/y&traits.newsletter=true&trait.x.y="abcd

Workarounds or alternatives

Currently only work around is to change the feature's flow

We let user register simply with newsletter = false
Upon registration when user is redirected to the app's domain, this is when we trigger a dialog box and let user make some trait selections

Upon trait selection submission, we make Ory API call to update those selections

Version

Latest Stable

Additional Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how /self-service/registration/browser handles flow-creation query parameters, especially the existing return_to parameter and the attempted traits and prefill forms. Done means a supported way to provide default trait values during registration flow creation, with the behavior applying to the requested flows and preserving existing return_to handling.

Written by the indexing model from the issue text.

Assessment

Domain
authentication
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.