<@U04UQ68083H> how can I determine if a user’s acc...
# ory-copilot
l
@chilly-king-10285 how can I determine if a user’s account was verified because they completed a recovery flow?
b
A message from kapa.ai
To determine if a user's account was verified because they completed a recovery flow, you can look at the response from the recovery flow API. Specifically, the
continue_with
field in the response contains information about the next steps after the recovery flow is completed. According to the [Ory API Reference](https://www.ory.sh/docs/reference/api), when a recovery flow is successful, the response includes a
continue_with
array. This array can contain different actions, including one that indicates the account has been verified:
Copy code
json {   "continue_with": [     {       "action": "show_verification_ui",       "flow": {         "id": "...",         "url": "...",         "verifiable_address": "..."       }     }   ] }
If the
continue_with
array includes an item with
"action": "show_verification_ui"
, it means that the account has been verified as part of the recovery process. Additionally, the [Account Recovery Documentation](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset#account-recovery-address) states: "If the email address used for recovery is the same as the email used for verification and the account isn't activated when the recovery flow is started, completing the recovery flow also verifies the user's email address." This means that if the recovery email matches the verification email and the account wasn't previously verified, the recovery process will automatically verify the account. To implement this in your application, you should check the response from the recovery flow API for the
continue_with
array and look for the
show_verification_ui
action. If present, you can consider the account verified.
l
@chilly-king-10285 how can I determine this from a payload to an after recovery webhook?
b
A message from kapa.ai
To determine if a user's account was verified as part of a recovery flow from a payload to an after recovery webhook, we need to look at the webhook payload structure. However, the knowledge sources provided don't contain specific information about the payload structure for after recovery webhooks. The closest relevant information we have is about the
continue_with
field in the recovery flow response, as mentioned in the [Ory API Reference](https://www.ory.sh/docs/reference/api). This field indicates the next steps after a recovery flow is completed, which could include account verification. Additionally, we know from the [Ory documentation on hooks](https://www.ory.sh/docs/kratos/hooks/configure-hooks#action-triggers) that there is an "after recovery" hook:
Copy code
- `after` recovery: The hook runs when the user successfully recovers their password.
However, the exact payload structure for this webhook is not provided in the given knowledge sources. To accurately answer your question about determining account verification from an after recovery webhook payload, we would need more specific documentation about the webhook payload structure. Without this information, I cannot provide a definitive answer on how to determine this from the webhook payload. If you need this specific information, I recommend checking the latest Ory documentation or contacting Ory support for detailed information about the after recovery webhook payload structure.