Coherence v0.3.0 Coherence.Config

Coherence Configuration Module.

Provides a small wrapper around Application.get_env :coherence, providing an accessor function for each configuration items.

Configuration items can be defined as either a single atom or {name, default} tuple. Each of the items can be included in your config/config.exs file.

The following items are supported:

  • :module: the name of project module (module: MyProject)
  • :repo: the module name of your Repo (repo: MyProject.Repo)
  • :user_schema
  • :schema_key
  • :logged_out_url
  • :email_from
  • :email_reply_to
  • :site_name - The site name used for email
  • :login_cookie (“coherence_login”) - The name of the login cookie
  • :auth_module (Coherence.Authentication.Session)
  • :create_login (:create_login)
  • :delete_login (:delete_login})
  • :opts ([])
  • :reset_token_expire_days (2)
  • :confirmation_token_expire_days (5)
  • :max_failed_login_attempts (5)
  • :unlock_timeout_minutes (20)
  • :unlock_token_expire_minutes (5)
  • :session_key (“session_auth”)
  • :rememberable_cookie_expire_hours (2*24)
  • :password_hash_field (:password_hash) - The field used to save the hashed password
  • :login_field (:email) - The user model field used to login
  • :changeset - Custom user changeset

Examples

alias Coherence.Config

Config.module

Summary

Functions

assigns_key(opts \\ :current_user)
auth_module(opts \\ Coherence.Authentication.Session)
changeset(opts \\ nil)
confirmation_token_expire_days(opts \\ 5)
create_login(opts \\ :create_login)
delete_login(opts \\ :delete_login)
email_from(opts \\ nil)
email_reply_to(opts \\ nil)
get(key, default \\ nil)

Get a configuration item.

has_option(option)

Test if an options is configured.

logged_out_url(opts \\ nil)
login_cookie(opts \\ "coherence_login")
login_field(opts \\ :email)
max_failed_login_attempts(opts \\ 5)
module(opts \\ nil)
opts(opts \\ [])
password_hash_field(opts \\ :password_hash)
repo(opts \\ nil)
reset_token_expire_days(opts \\ 2)
schema_key(opts \\ nil)
session_key(opts \\ "session_auth")
site_name(opts \\ nil)
unlock_timeout_minutes(opts \\ 20)
unlock_token_expire_minutes(opts \\ 5)
user_schema(opts \\ nil)

Macros

password_hash()