riverrun / openmaize

No longer maintained - was an Authentication library for Plug-based applications in Elixir
Other
206 stars 30 forks source link

Password reset can't handle non existing email address #92

Closed fabrik42 closed 7 years ago

fabrik42 commented 7 years ago

Hi! I just stumbled over a small bug in the PasswordResetController.create/2 function.

At the moment, the function can't handle the use case, where a user enters an email address that can't be found in the database.

The affected code is here: https://github.com/riverrun/openmaize/blob/master/installer/phoenix/templates/phx_html/password_reset_controller.ex#L16

Repo.get_by(User, email: email) will return nil and will cause the User.reset_changeset to throw an error.

I fixed this problem in my local installation and could provide PR with a fix and specs if this is wanted.

riverrun commented 7 years ago

Thanks for pointing this out. I'll let you know when I've fixed it - it should be tomorrow some time.

fabrik42 commented 7 years ago

Thank you! Let me know if I can help!

riverrun commented 7 years ago

Fixed in the latest version of the installer.

fabrik42 commented 7 years ago

Thank you!