Packages

Provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes.

Current section

Files

Jump to
access_pass lib access_pass application.ex
Raw

lib/access_pass/application.ex

defmodule AccessPass.Application do
# See http://elixir-lang.org/docs/stable/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
# Define workers and child supervisors to be supervised
if(Application.get_env(:access_pass, :sync) == true) do
SyncM.start()
end
children =
if Application.get_env(:access_pass, :repo) == nil do
[
supervisor(AccessPass.Repo, []),
supervisor(AccessPass.TokenSupervisor, [])
]
else
[
supervisor(AccessPass.TokenSupervisor, [])
]
end
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :rest_for_one, name: AccessPass.Supervisor]
Supervisor.start_link(children, opts)
end
end