riverrun / openmaize

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

Configurable field for login check #12

Closed dmarinortega closed 8 years ago

dmarinortega commented 8 years ago

Currently openmaize forces you to use the "name" field in User model for Authentication, but I think by a having a additional config parameter (defaulted to name, so it maintains its' current usability) but that might add easier adoption for existing systems, that use email, or username fields as login method.

dmarinortega commented 8 years ago

Just saw that this was implemented on last commit

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]