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

Visiting of reset password link not possible #37

Closed
pmuens opened this issue Nov 11, 2015 · 7 comments
Closed

Visiting of reset password link not possible #37

pmuens opened this issue Nov 11, 2015 · 7 comments
Labels

Comments

@pmuens
Copy link
Member

pmuens commented Nov 11, 2015

Route is forbidden to visit.

@michaltakac
Copy link
Contributor

This is not a bug actually, reset password route will be only visible for people who click on reset password link which will be sent to user's email after requesting that reset. First we need to implement the mailer functionality (I added hints and documented the process of such implementation to my 2nd pull request you merged).

Logged-in users can change their passwords here http://joingravity.com/change-password, so adding link to /change-password route somewhere into user profile settings would be good thing.

@pmuens
Copy link
Member Author

pmuens commented Nov 12, 2015

Yes, I've implemented the mailer functionality and have requested a new password. After clicking on the link in the E-Mail I was redirected to the route where I could change my password but I was redirected to the sign in page with the hint that I should sign in first.

I'll look into it ASAP.

@diegonc
Copy link
Contributor

diegonc commented Apr 28, 2016

I think you need to call AccountsTemplate.configureRoute in the server too.
Here's the code which makes me beleive that:

  if (Meteor.isServer) {
    // Configures "reset password" email link
    if (route === "resetPwd") {
      var resetPwdPath = options.path.substr(1);
      Accounts.urls.resetPassword = function(token) {
        return Meteor.absoluteUrl(resetPwdPath + "/" + token);
      };
    }

and if I add console.log("*****", Accounts.urls.resetPassword("the-token")); to server's startup I can see the URL with a hash:

I20160428-19:29:12.671(-3)? ***** http://localhost:3000/#/reset-password/the-token

But I'm not sure where would be the right place and whether other configuration calls are also required.

I guess I'll try moving client/lib/accounts/config.js to lib/accounts/ and report back :)

@diegonc
Copy link
Contributor

diegonc commented Apr 28, 2016

I guess I'll try moving client/lib/accounts/config.js to lib/accounts/ and report back :)

It worked. And everything else looks to be fine. Although I'm running a modified version of Gravity, I believe it should work on the pristine version too, I haven't changed much regarding the way accounts are handled.

@pmuens
Copy link
Member Author

pmuens commented Apr 29, 2016

@diegonc Great. Could you submit a PR? Then I'll merge it ASAP.

@diegonc
Copy link
Contributor

diegonc commented Apr 29, 2016

Done :-)

@pmuens
Copy link
Member Author

pmuens commented Apr 29, 2016

Great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants