<@U04UQ68083H> With the new two-step registration ...
# ory-copilot
s
@chilly-king-10285 With the new two-step registration in Kratos, is it possible to only display inputs for required traits in the first step?
c
A message from kapa.ai
Yes, it is possible to display inputs for required traits in the first step of the two-step registration process in Kratos. The required traits are defined in the identity schema and are marked with an asterisk for easy visual identification. When users try to register without filling in the mandatory fields, Ory Account Experience shows a message that tells users they must provide the mandatory information to proceed. In the two-step registration process, the user is prompted for the identity traits in the first step, and asked to choose a credential method for authentication next. This results in a more streamlined user experience. Here is an example of how to define required fields in the identity schema:
Copy code
json {     "$id": "<https://schemas.ory.sh/presets/kratos/identity.basic.schema.json>",     "title": "Person",     "type": "object",     "properties": {       "traits": {         "type": "object",         "properties": {           "email": {             "type": "string",             "format": "email",             "title": "Email address",             "<http://ory.sh/kratos|ory.sh/kratos>": {               "credentials": {                 "password": {                   "identifier": true                 },                 "webauthn": {                   "identifier": true                 },                 "totp": {                   "account_name": true                 }               },               "recovery": {                 "via": "email"               },               "verification": {                 "via": "email"               }             },             "maxLength": 320           },           "name": {             "type": "object",             "required": [               "last"             ],             "properties": {               "first": {                 "type": "string",                 "title": "First name",                 "maxLength": 256               },               "last": {                 "type": "string",                 "title": "Last name",                 "maxLength": 256               }             }           }         },         "required": [           "email"         ],       "additionalProperties": false       }     }   }
In this example, the email address and last name are required fields. For nested objects such as
name
, the
required
property is added inside of the object. For more information, you can refer to the [Ory Kratos Documentation](https://www.ory.sh/docs/kratos/manage-identities/customize-identity-schema#mandatory-fields-for-registration).
s
@chilly-king-10285 In this example, can the optional name trait input be hidden in the first step?
c
A message from kapa.ai
New message text here