Hello! Does Kratos provide any mechanism to forwar...
# ory-selfhosting
b
Hello! Does Kratos provide any mechanism to forward webhooks information to clients? Imagine an after login webhook that would fail when the identity is in a particular state. Is there any way I could provide additional info to clients? I'm testing with
parse: true
and sending a 400 response with a body like:
Copy code
{
  "messages": [
    {
      "instance_ptr": "#/traits/foo/bar",
      "messages": [
        {
          "id": 1234,
          "text": "trying to block login request due to a reason",
          "type": "error"
        }
      ]
    }
  ]
}
but kratos is redirecting to the login callback (not even to error callback). On kratos I only see the following log:
Copy code
"audience":"application","duration":42455542,"error":{"message":"1 validation errors occurred:\n(0) I[#/traits/foo/bar] S[] a webhook target returned an error"
but the login request is not aborted and considered successful apparently. any help would be much appreciated. Thanks!
s
This is intended behavior and does basically what you want. Did you already fetch the flow after the webhook response? It should contain your custom message. A user should see that message and decide how to continue, that's why we don't abandon the flow or display a generic error page.
b
thanks @steep-lamp-91158 I see a redirect to my login callback
Copy code
login/callback?flow=ba40fc5d-d776-4aaf-96da-e403335b5a3c
how can I fetch the flow details?
or how does the flow work exactly?
s
Please check https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration for details on how to implement a custom UI.
b
thanks @steep-lamp-91158!