riverrun / openmaize

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

Confirm link can be requested multiple times #62

Closed paulgoetze closed 8 years ago

paulgoetze commented 8 years ago

I’m using the "confirmation email after signup" functionality similar to the one in the openmaize-phoenix example app with using the ConfirmEmail plug in my controller.

plug Openmaize.ConfirmEmail, [key_expires_after: 30] when action in [:confirm]

It looks like the confirmation link can be requested multiple times and always updates the user’s confirmed_at timestamp.

Is this expected behaviour, or should there be a check and an error message (sth. like "Your account is already confirmed") once the email was confirmed? Or is this something I would have to care about explicitly? If, what would be a good approach to do this check?

riverrun commented 8 years ago

Yes, you're right. It should result in an error if the user is already confirmed.

paulgoetze commented 8 years ago

Thanks @riverrun, that was fast!