user555
user555

Reputation: 1529

Change the resetpassword url host in meteor

I want to change the reset-password email template url

I want to change

localhost:3000/reset-password/dP8cuMPE220mEPA7l0uSRIq4

to

app.mysite.com/reset-password/dP8cuMPE220mEPA7l0uSRIq4

I've done this

  Accounts.emailTemplates.resetPassword.text = function(user, url) {
        url = url.replace('#/', '');
        url = url.replace('localhost:3000', 'app.mysite.com');
        return "Click this link to reset your password: " + url;
      };

This works on my localenvironment but when in production it doesn't have localhost:3000

so the url will not change

I want to change the host, how to do this?

Upvotes: 1

Views: 511

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

You need to set the ROOT_URL environment parameter. Meteor will use it to generate this link. So if you set ROOT_URL="http://app.myside.com/, then the generated url will be http://app.mysite.com/reset-password/blahBLAH.

Upvotes: 3

Related Questions