0
我目前在做一個使用設計寶石的項目。註冊,確認電子郵件以及登錄都運行良好。但在忘記密碼,我遇到了這個錯誤..我試圖通過懸停「更改我的密碼」文本檢查令牌http://localhost:3000/rails/mailers/user_mailer/reset_password_instructions收到的令牌是相同的在我的表1個錯誤禁止該用戶被保存:重置密碼令牌無效
注意:我遵循的指令我有一個關於該reset_password文件
重置密碼指令
<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>
用戶梅勒預覽
搜索# Preview all emails at http://localhost:3000/rails/mailers/user_mailer
class UserMailerPreview < ActionMailer::Preview
def confirmation_instructions
@user = User.last
@getUser = User.find(@user)
@token = @getUser.confirmation_token
Devise::Mailer.confirmation_instructions(@user, @token)
end
def reset_password_instructions
@user = User.last
@getUser = User.find(@user)
@token = @getUser.reset_password_token
Devise::Mailer.reset_password_instructions(@user,@token)
end
end
問題:我該如何解決這類錯誤?
Umm..is之前'resetting'密碼的用戶'confirmed'? –
Yess ..我在重置密碼之前確認了它 – Angel
請分享您看到的確切錯誤.. –