dazzling-napkin-4938
01/11/2023, 4:47 AMdazzling-napkin-4938
01/11/2023, 5:08 AMbland-eye-99092
01/11/2023, 6:49 PMtraits , but those would be visible (and editable, after the registration) to the user in the default settings UI. You could of course filter those out, if you build the UI on your own. And if you just need to verify the code during the registration, this should not be an issue.
In essence, you would set the identity schema to include
"invitationCode": {
type: string,
title: "Invitation Code"
}
This would then be included in any registration flow’s nodes in Kratos and is a mandatory field for the user to fill out during registration.
Then you could add a hook to the registration, and include a JSONNET configuration that includes ctx.identity.traits.invitationCode and that calls your backend. You should be able to set can_interrupt to true, so your backend can decide if the invitation code is valid, or not. You can read more on that here: https://www.ory.sh/docs/kratos/hooks/configure-hooks#webhooks