Hi team, We have a question regarding the invite ...
# ory-network
b
Hi team, We have a question regarding the invite identity flow in Ory. In our product, a business owner can invite new staff members using the following flow: 1. The business owner creates a new staff member 2. The new staff member receives an invitation email 3. The new staff member clicks the link to accept the invitation 4. A page is shown where the user sets a password 5. The new staff member submits the password 6. The user is redirected to the login page We saw that a similar flow is described here: https://www.ory.com/docs/kratos/manage-identities/invite-users Our question is about email verification in this flow. If the email trait is marked as verifiable, when and how should verification happen for an invited identity? Thanks!
m
Hey @billions-translator-90566 I guess in your case you would want to show the verification UI after the first login: https://www.ory.com/docs/actions/require-verified-address#require-verification-on-login
b
Hi @magnificent-energy-493, Thanks for the clarification. In our case we would prefer not to show the verification UI as part of the login flow. Our desired flow is invite based and API driven: 1. We need to create a new identity without a password. 2. We need to send an invitation/verification email. 3. When the user clicks the link in the email, they should be directed to a page where they can set their password. 4. After completion, we need to receive a verified webhook so we can mark the user as verified in our platform. We would appreciate your guidance on how to implement this using APIs only, including which endpoints and flows to use, and any recommended best practices. Thanks!
m
Gotcha. Like I wrote last time you can trigger verification through the API and then use a post-verification Ory Action.
b
Thanks @magnificent-energy-493 Could you please explain how the user can be redirected to a set password page, step 3 in our flow, after clicking the link in the email? Is this possible without showing the verification UI? If not, is there another recommended approach to implement our use case?
Hi @magnificent-energy-493, Following up on my previous message with some testing results. I’ve been trying to implement the invite flow as follows: 1. Create identity via API 2. Create recovery link and send via email 3. User opens the link (leading to the Settings UI) 4. User sets and saves the password The issue: After step 4, Ory automatically sends a verification email. Since the user just arrived via a recovery link, we want to avoid this second email and mark them as verified. A few specifics I'm looking to clarify: 1. Is it possible to use an After Settings Action (method: password) to mark the identity as verified? Could this prevent the automatic verification email from being triggered? 2. If so, could this be done by enabling "Process response" on the action and using the webhook response to mutate the identity's
verifiable_address
directly in Ory? When receiving the webhook, we would also update the user as verified on our system. 3. Given our requirements, is this the right approach for our use case, or is there a more idiomatic way in Ory to link recovery-based invites with instant verification? Important context: We have another flow for business owner registration where we create a new identity with a password via API, and in that specific case, we do want the verification email to be sent.