【问题标题】:Link inside verification-mail not working验证邮件内的链接不起作用
【发布时间】:2018-08-18 18:53:45
【问题描述】:

谁能解释一下,或者更好地告诉我如何解决这个问题?

在 Parse-Server (/Heroku) 上的“帐户创建验证电子邮件”中找到的链接无效。

index.js中的相关代码是这样的:

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')
        },
      }
    }
  }
});

创建帐户后,验证邮件将按预期发送。 用户也收到它(如预期的那样)。邮件如下:

Please confirm your account by clicking on the link below.

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

但是,当单击此处的链接时,Web 浏览器中会显示:

Cannot GET /apps/YAdLIExyzABC(K 

这不是我所期望的。

有人能看出问题出在哪里吗?

在尝试了很多方法来解决这个问题之后,我注意到的另一件事是,在网络浏览器中键入以下行时:

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

我明白了:

无法获取 /apps/

我觉得这不应该发生。但是有人知道为什么会这样吗?

【问题讨论】:

  • 嘿伙计,你找到解决办法了吗?

标签: node.js parse-server mailgun pfuser email-verification


【解决方案1】:

URL 部分 YAdLIExyzABC(K#!qB...... 是您的应用 ID。

应用 ID 似乎包含不允许在 URL 中使用的无效字符,例如 (#!。应用 ID 应仅包含字符和数字。

在您在此处发布的配置中,您将应用 ID 替换为 .....,因此要确定,有必要查看您实际设置为应用 ID 的内容。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-13
    • 2011-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多