meteor-useraccounts / flow-routing

Useraccounts packages add-on for integration with Flow Router and Blaze Layout.
https://atmospherejs.com/useraccounts/flow-routing
MIT License
72 stars 50 forks source link

verify-email link incorrect #25

Closed timothyarmes closed 8 years ago

timothyarmes commented 8 years ago

When I change password the email that gets sent is the default Meteor one, i.e.

https://server/#/verify-email/token

Rather than the User Accounts one:

https://server/verify-email/token

Looking at the code I can't see why this is failing since you appear to be overwriting Meteor's URL correctly. Is this a known issue?

jshimko commented 8 years ago

I guess I wasn't aware there was a useraccounts template for that email. Where are you seeing that?

jshimko commented 8 years ago

Pretty sure the only thing useraccounts (and this package) does is call the default Accounts.verifyEmail from Meteor from a custom route you can optionally define.

https://github.com/meteor-useraccounts/flow-routing/blob/master/lib/core.js#L229

jshimko commented 8 years ago

Wait, I read that too fast. Starting over...

Are you talking about Accounts.sendVerificationEmail? That only optionally happens here and here and is using the meteor default . And the only way you can change that email content (and the included url) is by resetting the value of Accounts.emailTemplates.verifyEmail.text or Accounts.emailTemplates.verifyEmail.html (which useraccounts does not do, as far as I can tell)

http://docs.meteor.com/#/full/accounts_emailtemplates

Also, you said "when I change the password". So now I'm not even sure if we're talking about the same thing. :)

timothyarmes commented 8 years ago

Sorry, I'll start over.

Whenever Accounts.sendVerificationEmail is called (such as when a user changes their password) the email includes a link to the verification URL.

My problem was that that link wasn't the right one. It pointed to the built-in link rather than the one configured in UserAccounts.

However, I just sat down to debug the problem and discovered that it was my fault :) I wasn't calling AccountsTemplates.configureRoute on both the client and server.

Tim

chrise86 commented 8 years ago

I'm having a problem getting this working with Meteor 1.3 and React. The issue is with trying to call .configure on both the client and server, when my React templates all live on the client only, so cannot set the defaultLayout within a .configure block on the server. But if I don't, adding .configureRoute(forgotPwd) on the server results in:

Error: forgotPwd route configured but showForgotPasswordLink set to false!