Skip to content
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

AccountsReactComponent does not route to /reset-password as token is in path #10

Open
lc3t35 opened this issue Aug 1, 2018 · 2 comments

Comments

@lc3t35
Copy link

lc3t35 commented Aug 1, 2018

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);
};
@rGiladi
Copy link
Owner

rGiladi commented Aug 9, 2018

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!

@pixlol
Copy link

pixlol commented Sep 3, 2018

Yes this is indeed an issue.

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

No branches or pull requests

3 participants