Skip to content

fix: hide recovery link on refresh #263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2023
Merged

fix: hide recovery link on refresh #263

merged 2 commits into from
Jun 21, 2023

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Jun 19, 2023

Closes ory/kratos#3047

Related Issue or Design Document

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

Comment on lines 144 to 153
if (flow.refresh) {
initRecoveryUrl = getUrlForFlow(
kratosBrowserUrl,
"recovery",
new URLSearchParams({
return_to:
(return_to && return_to.toString()) || flow.return_to || "",
}),
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we don't refresh the flow at all and we are logging in for the first time? Then the recovery link will be gone right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better way might be to retrieve the session and then check if the user is already logged in. Based on that + refresh true we can hide the recovery link.

We will also need to omit the forgotPasswordURL property from additionalProps in the UserAuthCard function since we don't want to show the link at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, that should be inverted. Thanks!

@aeneasr aeneasr merged commit e4e99b7 into master Jun 21, 2023
@aeneasr aeneasr deleted the fix-3047 branch June 21, 2023 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refresh login -> recovery flow broken
2 participants