Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kieckhafer
Copy link
Member

@kieckhafer kieckhafer commented Oct 24, 2019

Resolves #5726
Impact: critical
Type: bugfix

Issue

The reset-password route does not correctly render the right component, making it impossible for you to reset your password unless you are under certain circumstances, like an admin who is logged in.

In addition, there was an issue related to this Password reset being a GQL mutation. On this page, there is no user, so meteor-login-token is not set. However, we were setting that value to null, instead of leaving it undefined. GQL was trying to use null as an auth check, which was throwing Unauthorized errors.

By leaving the meteor-login-token as undefined, we are able to use this mutation without being logged in / null.

Solution

  • Add a URL check to see if the route is reset-password, and show the form if it is.
  • Add a check to make sure meteor-login-token is a value or undefined, but not null

Notes

This does not fix the underlying problem, which is that the reset-password route doesn't register as it should and instead says not-found for the name of the route. It provides a temporary fix to the issue we are seeing until we can move authentication to it's own app.

Breaking changes

None.

Testing

  1. Register for an account
  2. Use the password reset email to reset your password
  3. See that you land on the password reset page after clicking the link in the email

@kieckhafer kieckhafer changed the title Fix kieckhafer password reset fix: password-reset route not working correctly Oct 24, 2019
@kieckhafer kieckhafer changed the base branch from release-v2.8.0 to develop October 24, 2019 21:51
Signed-off-by: Erik Kieckhafer <[email protected]>
Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

I can see the reset password page, but cannot reset the password. The form hangs with a spinner forever after submitting it. The error I get is below.

errorClass {message: "Match error: Expected string, got undefined", path: "", sanitizedError: errorClass, errorType: "Match.Error", stack: "Error: Match error: Expected string, got undefined…4032cc20b589152bd2e905ef16f0748d26b2fa4:198317:5)"}

@kieckhafer
Copy link
Member Author

@mikemurray can you recheck this please?

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

Reset seems to work, but I'm being redirected to a white screen with no console errors. I have the storefront urls set for both homepage and login url.

throw new ReactionError("error-occurred", "Missing storefront URLs. Please set these properties from the shop settings panel.");
} else {
window.location.href = storefrontUrls.storefrontLoginUrl;
Router.go(storefrontUrls.storefrontLoginUrl);
Copy link
Member

Choose a reason for hiding this comment

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

This should still probably be window.location.href you're redirecting to a different site. Router.go is really only for push state within this app context.

Signed-off-by: Erik Kieckhafer <[email protected]>
Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

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

👍

@kieckhafer kieckhafer merged commit 69f43c0 into develop Nov 6, 2019
@mikemurray mikemurray deleted the fix-kieckhafer-passwordReset branch November 6, 2019 19:45
@kieckhafer kieckhafer restored the fix-kieckhafer-passwordReset branch November 8, 2019 20:41
@kieckhafer kieckhafer mentioned this pull request Nov 8, 2019
@kieckhafer kieckhafer deleted the fix-kieckhafer-passwordReset branch November 22, 2019 00:56
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.

4 participants