[英]Devise gem to check encrypted password with current password
In my Ruby on Rails application, we are using devise gem Encryptor
module to encrypt the password from login page. 在我的Ruby on Rails应用程序中,我们使用devise gem
Encryptor
模块对登录页面中的密码进行加密。 My user model has encrypted password and does not store password in raw form. 我的用户模型具有加密的密码,并且不以原始格式存储密码。
I have password update feature for user and need to check current password. 我具有用户的密码更新功能,需要检查当前密码。 I need to validate with the encrypted password from user model using devise encryptor module which uses bcrypt and klass .
我需要使用使用bcrypt和klass的devise加密器模块,使用用户模型中的加密密码进行验证。 How can I achieve it
我该如何实现
Devise在模型中提供了有效的密码valid_password?(raw_password_to_check)
方法以进行密码检查
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.