Best way to require password when updating user model (ie user's email)
Hi!
I'd like to ensure the user sends up a valid password when updating their email. I've followed the reconfirmation section of your README, but that suggests (requires?) that we use user.update_with_email (as seen in dummy project mutation), but I'd like to use user.update_with_password since that offers the validation I need.
Wondering if you have any solutions to this?
Thank you!
PS: Currently using user.valid_password? before user.update_with_email, which works fine. Happy to close this if you think its the best way.
Hey @keithmgould! What you are doing is definitively the best way to do it for the current version of the gem. This is something I did think about when implementing the update_with_email method. So you are talking about a method that would do both things, right? Something like update_with_email_and_password. That's probably the way I'd go so the dev can choose from those 3 depending on what they are trying to implement.
So, if that's what you mean, lets keep this one open as I do think it'd be a nice addition to the gem. We'll work on it as soon as we can, but as always, anyone is welcome to create a PR that solves this 😉