When a user tries to delete their account, I want to display a confirmation screen in which they have to put in their current password. How do I go about checking if their inputted password is their current password?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can check by using
#valid_password?http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable#valid_password%3F-instance_methodSo
current_user.valid_password?(pass)