ant45de
ant45de

Reputation: 822

Meteor Accounts Routing

I use Meteor Accounts package but not the accounts-ui. If I send a verify email when user is created the following link is provided in the email: http://localhost:3000/#/verify-email/06apVGBQypZAzpXZp4bPOYzn0-jCS9rR7ENkr8jkQRr If I open this link this route is redirected to http://localhost:3000/# and the template I defined for / is rendered. I can then access the Accounts._verifyEmailToken thats not a problem. But I dont want this route /# to be taken.

How can I say the Accounts package that I want to be redirected to my the route I want (in my case /app)?

My attempts so far:

  1. Redirect /# with iron router to /app ==> not working
  2. Having a look in the source code of accounts package. There are URLS provided with Meteor.absoluteUrl. But I don't want to change the source code of the package.

What ideas do you have to let the package route to /app afterwards and still have the token accessable in javascript?

Upvotes: 0

Views: 32

Answers (1)

abj27
abj27

Reputation: 131

You can configure the url of the different mails in the Account package, like this

 Accounts.urls.verifyEmail= function(token){
    return Meteor.absoluteUrl("/app/"+token+"/");
 };

Just overwrite the method on the server side.

Upvotes: 1

Related Questions