导轨 - 重置密码链接不起作用(设计)



在重置密码邮件中,我得到的链接为

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'

并在开发.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 中使用安全性较低的应用重新启动服务器

最新更新