accounts-react
accounts-react copied to clipboard
AccountsReactComponent does not route to /reset-password as token is in path
In the given example
return (
<AccountsReactComponent
history={history}
route={path}
token={params.token} // for the reset-password route
/>
)
when path is '/reset-password/:token', it does not route accordindly as it is not one of the valid state this allows to get rid of /:token
route={path.indexOf('/reset-password') !== -1 ? '/reset-password' : path}
Maybe you can change AccountsReactComponent (not easy on first look) or just update the example ?
Also I noticed that it is not mentionned to add this code on server side
import { Meteor } from 'meteor/meteor';
import { Accounts } from 'meteor/accounts-base';
Accounts.urls.resetPassword = function (token) {
return Meteor.absoluteUrl('reset-password/' + token);
};
If i'm not wrong, "path" should return the raw url specified in the Route component but i'll check into that once I can.
And thanks, i'll update the the documentation with Accounts.urls.resetPassword!
Yes this is indeed an issue.