I'm not sure if this is just an inconsistency or b...
# talk-kratos
t
I'm not sure if this is just an inconsistency or by design, but would be great to get some clarification (maybe one for @narrow-van-43826) The recovery code endpoint returns both
recovery_code
and
recovery_link
in the response. However, the templating for Courier, only exposes the
recovery_code
,
recovery_link
is always
null
Example payload from Courier (using
delivery_strategy: http
Copy code
{
  "name": null,
  "recipient": ""ello@workd.com7755",
  "recovery_url": null,
  "template_type": "recovery_code_valid",
  "to": "<mailto:hello@world.com|hello@world.com>",
  "verification_url": null
}
b
This is deliberate, because the self-service recovery sets anti-CSRF tokens during the flow, which means that accessing the flow from e.g. a different browser, or doing something in between, will result in the flow failing. In the admin endpoint we deliberately disable the CSRF protection, because we assume that the admin would do the verification of the user (e.g. they are making sure the user is actually the owner of the account), making a CSRF attack unlikely to impossible.
t
That makes sense, thanks for the clarification!