I'm not sure if I'm being dumb here, but an exampl...
# general
c
I'm not sure if I'm being dumb here, but an example of how you would implement registration with custom fields would be useful. I have fields that need to be validated before registration completes. I haven't attempted to try anything because I'm still unsure how to even do this, I know hooks could be used, but what if for example a field errors out, how do I return this via the hook and back to the registration flow? Now I could just take the registration on the server and call Ory Krators API to create the identity, but for some reason this doesn't seem like the recommended method of achieving this.
p
Hi @creamy-fall-97349 What do you mean by "I have fields that need to be validated before registration completes.". Why not add the validation to the identity schema and have them validated by Kratos? if you are doing a server-side rendered page, posting the data to Kratos, any errors thrown will redirect you back to the registration page (your server-side rendered page) through which you can get the errors using the flowId. We have an example of this in https://github.com/ory/kratos-selfservice-ui-node which is used by the quickstart
Here is documentation on how to validate the input using the identity schema https://www.ory.sh/docs/kratos/concepts/identity-schema#sanitize-usernamestraits