Hi :wave: <Create Recovery Flow for Browsers> sect...
# ory-network
h
Hi đź‘‹ Create Recovery Flow for Browsers section of REST API Reference mentions a
return_to
parameter of a recovery flow
return_to
–
string
The URL to return the browser to after the flow was completed.
Assuming we use the default user profile UI of Ory Network, what user action would complete the recovery flow and redirect the user to the target
return_to
address?
f
@proud-plumber-24205 can you help here? thanks!
p
Hey @handsome-agency-20541 When you do a recovery flow with a
return_to
query parameter the browser will be redirected after submitting a settings update - since recovery is about setting up new credentials. So with the Account Experience the flow will be: 1. Create recovery flow with
return_to
2. Submit recovery code on recovery page 3. Redirect to settings page 4. Submit a new password 5. Get redirected to
return_to
url
h
@proud-plumber-24205 is that specifically with the default Ory Network UI? Because that’s not what I see happening.
p
This can be done on Ory Account Experience (built in project UI) and with custom UI. Go to the recovery page https://<projecturl>/ui/recovery?return_to=<url>
you can even initialize the flow through https://<projecturl>/self-service/recovery/browser?return_to=<url>
*note you need to add the URL to the allow list in the Browser Redirect settings on the console https://www.ory.sh/docs/concepts/redirects#allow-list
h
Already added. Without it a recovery flow refuses to start.
When I submit a new password, I just get a green “Your changes have been saved!” line at the top of the profile page, and no redirects.
I can share a HAR or a video of the whole process with you in PM. Would you be interested in checking that?
p
Alright, sounds good
👍 1
Okay for anyone else struggling with this issue. When a second factor is added to the account, the recovery flow redirects to the login flow asking for the second factor. Since the second factor is asked the
return_to
parameter is removed from the recovery flow, since it is now a new flow through login. Also found the related issue https://github.com/ory/kratos/issues/2832