Link inside verification-mail not working

2019-07-30 12:43发布

问题:

Could somebody explain, or better tell me how to fix this problem?

The link found in the "account creation verification email" on Parse-Server (/Heroku), is not working.

The relevant code in index.js is like this:

var api = new ParseServer({
  databaseURI: .....,
  cloud: .....,
  appId: .....,
  ..........
  publicServerURL: process.env.PARSE_PUBLIC_SERVER_URL || 'https://myapp.herokuapp.com',
  appName: 'WonderApp',
  ..........
  verifyUserEmails: true,
  emailAdapter: {
    module: 'parse-server-mailgun',
    options: {
      // The address that your emails come from
      fromAddress: 'yaya@abc.com',
      // Your domain from mailgun.com
      domain: 'xyz.com',
      // Your API key from mailgun.com
      apiKey: 'key-key-key-key-key-key-key-key',
      // The template section 
      templates: {
        verificationEmail: {
          subject: 'Confirm your account',
          pathPlainText: resolve(__dirname, 'verification_email.txt')
        },
      }
    }
  }
});

The verification mail is sent as expected, when an account is created. The user also receives it(as expected). The mail looks like:

Please confirm your account by clicking on the link below.

https://myapp.herokuapp.com/apps/YAdLIExyzABC(K#!qB....../verify_email?token=....uxY&username=theguy

But, then when clicking the link here what appears in the web browser:

Cannot GET /apps/YAdLIExyzABC(K 

This is not what I expect.

Could someone see where the problem could be?

One more thing I noticed, after trying many things to solve this problem is that, when typing the following line in the web browser :

https://myapp.herokuapp.com/apps/

I get this:

Cannot GET /apps/

I have the feeling this is not supposed to happen. But does anyone know why this happens?