manukall / phoenix_token_auth

Token authentication solution for Phoenix. Useful for APIs for e.g. single page apps.
MIT License
163 stars 39 forks source link

Configuration without anonymous functions #12

Closed alfert closed 9 years ago

alfert commented 9 years ago

Anonymous functions in the config file are elegant, but they do not work properly with exrm, which generates an Erlang-based sys.config file which cannot use the Elixir syntax. IMHO this configuration style is well suited for prototyping but not for production systems.

For an easy configuration a behaviour PhoenixTokenAuth.MailingBehaviour is defined for constructing the three different emails. It is sufficient to configure the name of the implementing module.

For the user model changeset validator a module and function can be configured instead of an anonymous function.

manukall commented 9 years ago

thanks for this. i really like the idea of the mailing behaviour. :+1: