riverrun / openmaize

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

Authentication email #11

Closed Immortalin closed 8 years ago

Immortalin commented 8 years ago

It would be great if a confirmation email feature can be added

riverrun commented 8 years ago

Could you give me a bit more information, please? There are two things I want to know:

  1. Why is it a good idea?
  2. What kind of workflow do you want? The last point means what do you want Openmaize to do, and what should be the responsibility of your app?
Immortalin commented 8 years ago
  1. Because you have to confirm whether the email given is a valid email belonging to the user.
  2. A config option to be enabled for the registration module. This can also be used for passwordless, email-only authentication such as those used by medium.
riverrun commented 8 years ago

That should be no problem. I'll look into it and then get back to you.

Immortalin commented 8 years ago

Here's some code that you might find helpful

riverrun commented 8 years ago

Just a progress report. This is almost finished - I'm just working on the example and fine tuning at the moment.

riverrun commented 8 years ago

This is finished now, but it might be a bit different from what you were expecting :) I've added functions to help with sending a confirmation email, but the actual sending of the email is something that the developer needs to do. There are two extra functions in Openmaize.Signup:

There is now a Openmaize.Confirm module, which contains the following function:

The Openmaize-phoenix example app has already been updated with these changes. See the web/controllers/page_controller.ex and web/models/user.ex files for more info.

Immortalin commented 8 years ago

@riverrun thanks!