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.ex
Raw

lib/access_pass.ex

defmodule AccessPass do
alias AccessPass.GateKeeper
# maybe validate password === password confirm
defdelegate logged?(token), to: GateKeeper, as: :check
defdelegate refresh(refresh_token), to: GateKeeper, as: :refresh
defdelegate register(user_obj), to: GateKeeper, as: :register
defdelegate confirm(confirm_id), to: GateKeeper, as: :confirm
defdelegate login(username, password), to: GateKeeper, as: :log_in
defdelegate reset_password(username), to: GateKeeper, as: :reset_password
defdelegate forgot_username(email), to: GateKeeper, as: :forgot_username
defdelegate logout(access_token), to: GateKeeper, as: :log_out
defdelegate change_password(password_id, new_password), to: GateKeeper, as: :change_password
end