Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to require password when updating user model (ie user's email) #148

Open
keithmgould opened this issue Jan 27, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@keithmgould
Copy link

keithmgould commented Jan 27, 2021

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.

@mcelicalderon
Copy link
Member

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 😉

@mcelicalderon mcelicalderon added the enhancement New feature or request label Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants