开发者

Having users provide current password to change password or email

开发者 https://www.devze.com 2023-04-03 12:26 出处:网络
I have a users authentication system I made from scratch with the help of the Rails cast and for the edit form I want to have the users need to type in their current password in order to change their

I have a users authentication system I made from scratch with the help of the Rails cast and for the edit form I want to have the users need to type in their current password in order to change their email or password.I'm not sure how this would be built, could anyone help me or point me in the right directi开发者_C百科on?

Thank you.


They'd enter the password, you'd encrypt it and compare it against the model's encrypted password value, and if they match, you'd do the update. If they don't, you wouldn't.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号