簡體   English   中英

Devise 忘記密碼 url 在 email 將用戶發送到錯誤的鏈接

[英]Devise forgot password url in email sending user to wrong link

很難弄清楚這個錯誤。 我們在 Rails 5.2 上安裝了 devise,並且有一個暫存和生產站點。 當用戶從臨時站點請求忘記密碼時,來自 email 的 url 會將用戶帶到正確的鏈接以重置其密碼。 在生產中,來自忘記密碼 email 的鏈接不正確,它會將用戶帶到互聯網搜索頁面,而不是我們網站的路徑,他們可以在其中重置密碼。

知道為什么生產鏈接不會將用戶帶到我們的網頁嗎?

我們從 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>

萬一其他人遇到這個問題並且無法弄清楚出了什么問題,這實際上是我們的 sendgrid 中的問題。 我們嘗試使用鏈接品牌,但 SPF 和 DMARC 設置不正確。 一旦我們擺脫了鏈接品牌,鏈接就很好了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM