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

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# v2.8.1
Reaction v2.8.1 adds a bug fix and contains no breaking changes since v2.8.0

This release is being coordinated with `reaction-platform` and is designed to work with `v2.8.1` of `example-storefront` and `reaction-hydra`.

## Notable changes

### Fix password reset issue

Password reset has been fixed to correctly send a password reset email, and re-direct the user once their new password has been set.

## Fixes

fix: password-reset route not working correctly ([#5744](https://github.com/reactioncommerce/reaction/pull/5744))

# v2.8.0

Reaction v2.8.0 adds performance enhancements and fixes bugs.
Expand Down
3 changes: 2 additions & 1 deletion imports/plugins/core/accounts/client/components/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Login extends Component {
super(props);

const currentRoute = Router.current().route;
const isPasswordReset = ["reset-password", "account/enroll"].includes(currentRoute.name);
const isPasswordReset = ["reset-password", "account/enroll"].includes(currentRoute.name) || currentRoute.path.includes("/reset-password/");

this.state = {
currentView: isPasswordReset ? "loginFormUpdatePasswordView" : props.loginFormCurrentView
Expand Down Expand Up @@ -61,6 +61,7 @@ class Login extends Component {
const isOauthFlow = currentRoute.options && currentRoute.options.meta && currentRoute.options.meta.oauthLoginFlow;
const idpFormClass = isOauthFlow ? "idp-form" : "";
const { currentView } = this.state;

if (currentView === "loginFormSignInView" || currentView === "loginFormSignUpView" || currentView === "loginFormUpdatePasswordView") {
if (isOauthFlow) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const wrapComponent = (Comp) => (
});
return;
}
const { token } = Router.current().params;

const { path } = Router.current().route;
const token = path.replace("/reset-password/", "");

Accounts.resetPassword(token, password, (error) => {
if (error) {
this.setState({
Expand Down
12 changes: 7 additions & 5 deletions imports/plugins/core/graphql/lib/helpers/initApollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const wsUrl = httpUrl.replace("http", "ws");
export const meteorAccountsLink = new ApolloLink((operation, forward) => {
const token = localStorage.getItem("Meteor.loginToken");

operation.setContext(() => ({
headers: {
"meteor-login-token": token
}
}));
if (token) {
operation.setContext(() => ({
headers: {
"meteor-login-token": token
}
}));
}

return forward(operation);
});
Expand Down
Loading