Storing given_name, family_name in root

I’m trying to collect and store given_name and family_name on the sign-up screen. My configuration is below and successfully causes the fields to show:

      additionalSignUpFields: [
          {
            name: "given_name",
            placeholder: "first name",
            storage: "root"
          },
          {
            name: "family_name",
            placeholder: "last name",
            storage: "root"
          }]

However, when a user is created, the data is saved in the user_metadata area instead of the root, which I have clearly specified according to the docs (https://auth0.com/docs/libraries/lock/v11/configuration#additionalsignupfields-array-). What am I doing wrong?

Good morning,

The additional signup fields will always be stored in the metadata, regardless how you name them.

You will need to assign them to the user’s standard claims via Rule .

Is the documentation just wrong then? The docs are very clear that given_name and family_name can be stored in the root here:

https://auth0.com/docs/libraries/lock/v11/configuration#additionalsignupfields-array-

If you want to save the value of the attribute in the root of your profile, use storage: 'root' . Only a subset of values can be stored this way. The list of attributes that can be added to your root profile is here. By default, every additional sign up field is stored inside the user_metadata object.

1 Like