簡體   English   中英

Rails-重置密碼鏈接不起作用(Devise)

[英]Rails - Reset Password Link not working (Devise)

在重置密碼郵件中,我得到的鏈接為

http//example.com/users/password/edit?reset_password_token而不是

http://example.com/users/password/edit?reset_password_token.

reset_password_instructions.html.erb

<p>Hello <%= @resource.email %>!</p>

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

<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_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>

在devise.rb中,您必須進行更改

config.mailer_sender = 'your_mail@gmail.com'

並在development.rb中添加以下內容

  config.action_mailer.smtp_settings = {
 :address              => "smtp.gmail.com",
 :port                 => 587,
 :domain               => 'domain.com',
 :user_name            => '*********@gmail.com',
 :password             => '***********',
 :authentication       => :plain,
 :enable_starttls_auto => true  }

在gmail中允許安全性較低的應用重新啟動服務器

暫無
暫無

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

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