![](/img/trans.png)
[英]Ruby on Rails, Devise gem. How to remove current password when password is blank?
[英]Why rails devise gem throws 'invalid current password' error if only password confirmation is blank?
我正在處理Rails應用程序上的續訂密碼屏幕錯誤,該應用程序具有三個輸入: current password
, new password
和password confirmation
。
在一種情況下, current password
正確,但new password
和password confirmation
為空白,但設計仍會引發2個錯誤:
有沒有人經歷過這種行為?
謝謝
我猜你的current_password
不正確。 有錯別字嗎?
讓我們更新密碼並再次測試!
user.password = new_password
user.password_confirmation = new_password
user.save
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.