You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the Change Password view, clicking 'Cancel' correctly changes the form fields to the login state, but does not update the route URL. Probably related to #83
Temporary workaround:
Extend Accounts.ui.LoginForm and supply a new buttons() method:
@premasagar Thank you for the workaround, I was able to get to a good enough solution thanks to it. However unlike you, I wasn't able to make the cancel button work by setting the href property. Instead, I overwrote the onClick callback to redirect to where I wanted.
Here's an example. I am able to access history by using the withHistory HOC from React-Router@4.
import{Accounts}from'meteor/std:accounts-ui';import{withRouter}from'react-router';classLoginFormextendsAccounts.ui.LoginForm{buttons(){constbuttons=super.buttons();const{ loginPath }=Accounts.ui._options;const{ history }=this.props;if(loginPath&&'cancelResetPassword'inbuttons){buttons.cancelResetPassword.onClick=()=>history.push(loginPath);}returnbuttons;}}exportdefaultwithRouter(LoginForm);
I have routes for
/change-password
and/login
(using React Router), which renderAccounts.ui.LoginForm
.On the Change Password view, clicking 'Cancel' correctly changes the form fields to the login state, but does not update the route URL. Probably related to #83
Temporary workaround:
Extend
Accounts.ui.LoginForm
and supply a newbuttons()
method:The text was updated successfully, but these errors were encountered: