Hello again. I would like to create a custom UI fo...
# ory-network
w
Hello again. I would like to create a custom UI for the password recovery screen. Not the one where you input your email then click "send", but the one you're sent to from that recovery mail. I realize they are the same address (
/recovery?flow=...
with the addition of
token=...
) but they are different pages! The example in https://github.com/ory/kratos-selfservice-ui-react-nextjs/blob/master/pages/recovery.tsx doesn't account for this so I don't understand how to do this other than just to search for the
token
query param...
p
Hi @white-article-28775 You need to send the user to a Post recovery screen. You can setup where the user should be redirected to in the project browser redirects screen. https://www.ory.sh/docs/concepts/redirects#verification-recovery-and-logout
w
I'm confused, the default email currently sends me to
/recovery?flow=...&token=...
, how is this differentiated from the post-recovery?
@proud-plumber-24205 from the page you sent There doesn't seem to be a post-recovery redirect. I am not in charge of our ory config so just trying to see if that' actually possible. Is the native one just to the setting screen? What if I need a password recovery flow that doesn't sign you in when I click the link?
p
There doesn't seem to be a post-recovery redirect.
Yes I believe you need to set the post settings URL since the recovery flow will immediately take you to the settings page. You can also pass along a
return_to
query parameter (as shown in our http api docs) with the expected screen you would like to see after recovery has been successful on the initial request. I see here is an issue asking about the post-recovery redirect url and as stated in the issue and our docs you will always be redirected to the settings with a valid session cookie. https://github.com/ory/kratos/issues/2371
What if I need a password recovery flow that doesn't sign you in when I click the link?
A recovery flow is used by the user to reset their password (they have forgotten their password and now want a to create a new one). To set a new password you need to have a session since it's going through the settings flow (update password, email, profile etc.).
w
i see...
so after clicking the link in the email, i am always redirected to the settings with a session, aka am signed in.
and i would need to setup a post-settings page to force a password reset
@proud-plumber-24205 did i get that right?
p
yes, that's correct
w
Alright then, thank you!
👍 1