My app works with the Devise gem for authentication, but I want customize it for sign in with two possible encrypted passwords, due to my previous app worked with MD5. I’ve two fields in my users table: encrypted_password and encrypted_old_password (I’ve created), I want check if exists the value encrypted_password and if the password sent matches the one set, otherwise, check if it does with MD5 and if true, then replace the value encrypted_password.
How I do this?
I don’t know if my answer is fancy, but works for me. I hope someone can improve what I did.