application_auth v0.1.0 ApplicationAuth.Accounts

Accounts context to handle accounts actions as abstraction

Link to this section Summary

Functions

Find an application with app_key and allowed hosts

Find an application with app_key and allowed hosts

Create a new application with credentials

Create a new user with credentials

Get a user by id

Get application by user

List all user applications

Link to this section Functions

Link to this function

authenticate_application(app_key)

authenticate_application(String.t()) ::
  {:ok, ApplicationAuth.Accounts.Application.t()} | {:error, Atom.t()}

Find an application with app_key and allowed hosts

Link to this function

authenticate_application(app_key, allowed_hosts)

authenticate_application(String.t(), String.t()) ::
  {:ok, ApplicationAuth.Accounts.Application.t()} | {:error, Atom.t()}

Find an application with app_key and allowed hosts

Link to this function

authenticate_user_by_email_and_password(email, password)

authenticate_user_by_email_and_password(String.t(), String.t()) ::
  {:ok, ApplicationAuth.Accounts.User.t()} | {:error, Atom.t()}

Find a user by email and password

Link to this function

create_application(user, attr \\ %{})

Create a new application with credentials

Link to this function

create_registered_user(attr \\ %{})

create_registered_user(Map.t()) ::
  {:ok, ApplicationAuth.Accounts.User.t()} | {:error, Ecto.Changeset.t()}

Create a new user with credentials

Get a user by id

Link to this function

get_user_application!(user, app_id)

Get application by user

Link to this function

get_user_by_email_credential(email)

get_user_by_email_credential(String.t()) ::
  ApplicationAuth.Accounts.User.t() | nil

Find a user by email

Link to this function

list_user_applications(user)

list_user_applications(ApplicationAuth.Accounts.User.t()) :: Enum.t()

List all user applications

Link to this function

update_application(application, attrs)

Update application