【问题标题】:Devise forgot password url in email sending user to wrong link在将用户发送到错误链接的电子邮件中设计忘记密码 url
【发布时间】:2020-12-22 22:31:51
【问题描述】:

很难找出这个错误。我们在 Rails 5.2 上进行了设计,并有一个登台和生产站点。当用户从登台站点请求忘记密码时,电子邮件中的 URL 会将用户带到正确的链接以重置其密码。在生产中,忘记密码电子邮件的链接不正确,它会将用户带到互联网搜索页面,而不是他们可以重置密码的网站路径。

知道为什么制作链接不会将用户带到我们的网页吗?

我们从 sendgrid 发送电子邮件。路线和信息如下...

edit_user_password GET    /users/password/edit(.:format)                                                           devise/passwords#edit
<p>Hello <%= @resource.email %>!</p>

<p>Someone has requested a link to change your password. You can do this through the link below.</p>

<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>

<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

【问题讨论】:

  • 你的 config.action_mailer.default_url_options 在 production.rb 中是什么样子的?
  • 您能发布一个正在发送的网址示例吗?
  • @RockwellRice 原来是 sendgrid 问题。我在 sengrid 中使用链接品牌,但设置不正确

标签: ruby-on-rails devise devise-recoverable


【解决方案1】:

如果其他人遇到这个问题并且无法弄清楚出了什么问题,这实际上是我们的 sendgrid 中的问题。我们尝试使用链接品牌,但 SPF 和 DMARC 设置不正确。一旦我们摆脱了链接品牌,链接就很好了。

【讨论】:

    猜你喜欢
    • 2013-06-24
    • 1970-01-01
    • 2016-08-31
    • 2011-02-19
    • 1970-01-01
    • 2018-08-17
    • 2013-06-23
    • 2013-06-13
    • 2015-06-22
    相关资源
    最近更新 更多