-
Notifications
You must be signed in to change notification settings - Fork 556
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
Add support for signup with root level attributes #1656
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@luisrudge - At first glance, this looks fine but does this just automatically start saving custom signup fields to a different place? What if someone is already using the current implementation and expects that data to continue to be saved to usermeta
? Isn't that breaking?
When we first started talking about this, my idea was to add a property to the signup fields JS to indicate that you want to save this to the root profile. Like so:
var options = {
additionalSignUpFields: [{
name: "full_name",
root_profile_field: "full_name"
placeholder: "Enter your full name"
}]
}
@joshcanhelp made it opt-in per field |
@joshcanhelp it doesn't change behavior for existing fields - right now they go to user metadata. The default for 'storage' is user metadata. The rationale for this design was to:
(A flag or opt-in to root profile attributes tied to that name, e.g. useRootProfileAttributes - fails objective 2 and 3) |
@joshcanhelp updated PR and description |
Changes
When using
additionalSignUpFields
, you can now use a new property calledstorage
to determine where the field will be stored.root
will save it in the root profile. anything else will save it underuser_metadata
. There is no default (which means it will save touser_metadata
).References
https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
Testing