riverrun / openmaize

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

Email field instead of name #10

Closed Immortalin closed 8 years ago

Immortalin commented 8 years ago

Is it possible to use email instead of name?

riverrun commented 8 years ago

Hi,

It will be when Elixir 1.2 comes out, which should be very soon. Then you'll be able to configure it.

riverrun commented 8 years ago

Added unique_id value to the config. Set this to "email" and make sure that your login form returns an email field. If you have any problems, let me know.

riverrun commented 8 years ago

With version 0.12, the way you implement this has changed. Now there is no configurable value for unique_id. You need to call unique_id when running Openmaize.Login, like this:

plug Openmaize.Login, [unique_id: :email] when action in [:login_user]
Immortalin commented 8 years ago

I see, thank you for implementing this!