plug_mishka_auth v0.0.2 MishkaAuth.Client.Users.ClientUserQuery View Source

this module helps us to handle users and connect to users database.

Link to this section Summary

Functions

this function accepts info which is created by map and adds user in Users table.

this function accepts id which was created and deletes user in Users table.

this function accepts info which is created by map and updates user in Users table.

edit user password with his email

systematic user activation

get user info with mail

get user info with id

get user info with username

this function has two job that can check user existed and user activated. it uses email for this

this function has two job that can check user existed and user activated. it uses id for this

this function starts push notification in this module.

this function can help you check user password is valid or not.

Link to this section Types

Specs

data_uuid() :: Ecto.UUID.t()

Specs

email() :: String.t()

Specs

password() :: String.t()

Specs

unconfirmed_email() :: email() | nil

Specs

username() :: String.t()

Link to this section Functions

Link to this function

add_password(user_id, user_password)

View Source

Specs

add_password(data_uuid(), password()) ::
  {:error, :add_password, :password_not_null | :user_not_found}
  | {:ok, :add_password, Ecto.Schema.t()}
  | {:error, :add_password, :data_input_problem, Ecto.Changeset.t()}

Specs

add_user(map()) ::
  {:error, :add_user, Ecto.Changeset.t()} | {:ok, :add_user, Ecto.Schema.t()}

this function accepts info which is created by map and adds user in Users table.

Link to this function

chack_password_not_null(pass)

View Source

Specs

chack_password_not_null(password()) ::
  {:error, :chack_password_not_null} | {:ok, :chack_password_not_null}
Link to this function

check_user_and_password(username, password, atom)

View Source

Specs

check_user_and_password(binary(), any(), :email | :user_id | :username) ::
  {:error, :check_user_and_password,
   :current_password | :email | :null_password | :user_not_found | :username}
  | {:ok, :check_user_and_password, :email | :user_id | :username,
     Ecto.Schema.t()}
Link to this function

delete_password(user_id)

View Source

Specs

delete_password(data_uuid()) ::
  {:error, :delete_password, :null_password | :user_not_found}
  | {:ok, :delete_password, Ecto.Schema.t()}

Specs

delete_user(data_uuid()) ::
  {:error, :delete_user, :user_doesnt_exist}
  | {:ok, :delete_user, Ecto.Schema.t()}
  | {:error, :edit_user, :data_input_problem, Ecto.Changeset.t()}
  | {:error, :delete_user, :forced_to_delete}

this function accepts id which was created and deletes user in Users table.

Specs

edit_user(data_uuid(), map()) ::
  {:error, :edit_user, :user_doesnt_exist}
  | {:ok, :edit_user, Ecto.Schema.t()}
  | {:error, :edit_user, :data_input_problem, Ecto.Changeset.t()}

this function accepts info which is created by map and updates user in Users table.

Link to this function

edit_user_password(email, attrs)

View Source

Specs

edit_user_password(email(), map()) ::
  {:error, :edit_user_password, :user_not_found}
  | {:ok, :edit_user_password, Ecto.Schema.t()}
  | {:error, :edit_user_password, :data_input_problem, Ecto.Changeset.t()}

edit user password with his email

Link to this function

edit_user_password_with_user_id(user_info, attrs)

View Source
Link to this function

edit_user_password_with_user_id(user_id, old_password, new_password)

View Source

Specs

edit_user_password_with_user_id(binary(), password(), password()) ::
  {:error, :edit_user_password_with_user_id,
   :current_password | :null_password | :user_not_found}
  | {:ok, :edit_user_password_with_user_id, Ecto.Schema.t()}
  | {:error, :edit_user_password_with_user_id, :data_input_problem,
     Ecto.Changeset.t()}
Link to this function

edit_user_verified_email(email)

View Source

Specs

edit_user_verified_email(email()) ::
  {:ok, :edit_user_verified_email}
  | {:error, :edit_user_password, :user_not_found}

systematic user activation

Link to this function

find_user_with_email(email)

View Source

Specs

find_user_with_email(email()) ::
  {:error, :find_user_with_email}
  | {:ok, :find_user_with_email, Ecto.Schema.t()}

get user info with mail

Link to this function

find_user_with_user_id(id)

View Source

Specs

find_user_with_user_id(data_uuid()) ::
  {:error, :find_user_with_user_id}
  | {:ok, :find_user_with_user_id, Ecto.Schema.t()}

get user info with id

Link to this function

find_user_with_username(username)

View Source

Specs

find_user_with_username(username()) ::
  {:error, :find_user_with_username}
  | {:ok, :find_user_with_username, Ecto.Schema.t()}

get user info with username

Link to this function

is_user_activated?(email)

View Source

Specs

is_user_activated?(email()) ::
  {:error, :is_user_activated?, :user_not_activated | :user_not_found}
  | {:ok, :is_user_activated?, Ecto.Schema.t()}

this function has two job that can check user existed and user activated. it uses email for this

Link to this function

is_user_activated_with_id?(id)

View Source

Specs

is_user_activated_with_id?(data_uuid()) ::
  {:error, :is_user_activated_with_id?, :user_not_activated | :user_not_found}
  | {:ok, :is_user_activated_with_id, Ecto.Schema.t()}

this function has two job that can check user existed and user activated. it uses id for this

Link to this function

reset_password(email, country, atom)

View Source

Specs

reset_password(email(), String.t(), :email) ::
  {:error, :reset_password, :find_user_with_email}
  | {:ok, :reset_password, Ecto.Schema.t()}
Link to this function

reset_password(email, code, new_password, atom)

View Source

Specs

reset_password(email(), String.t(), password(), :email) ::
  {:error, :reset_password, :same_code | :user_not_found}
  | {:ok, :reset_password, Ecto.Schema.t()}
  | {:error, :reset_password, :data_exist | :data_input_problem,
     String.t() | Ecto.Changeset.t()}
Link to this function

set_set_systematic_user_data(user_params, atom)

View Source

Specs

set_set_systematic_user_data(map(), :direct | :social) :: map()
Link to this function

show_public_info_of_user(user_id, atom)

View Source

Specs

show_users() :: Ecto.Repo.t() | [Ecto.Schema.t()]
Link to this function

show_users(pagenumber, page_size)

View Source

Specs

show_users(number(), number()) :: Scrivener.Page.t() | [] | [Ecto.Schema.t()]
Link to this function

show_users(pagenumber, page_size, status)

View Source

Specs

show_users(number(), number(), any()) ::
  Scrivener.Page.t() | [] | [Ecto.Schema.t()]

Specs

subscribe() :: :ok | {:error, any()}

this function starts push notification in this module.

Link to this function

valid_password(user_info, password)

View Source

Specs

valid_password(Ecto.Schema.t(), password()) ::
  {:error, :valid_password} | {:ok, :valid_password}

this function can help you check user password is valid or not.

Link to this function

verify_email(email, country, atom)

View Source

Specs

verify_email(email(), String.t(), :email) ::
  {:error, :verify_email, :find_user_with_email}
  | {:ok, :verify_email, Ecto.Schema.t()}
Link to this function

verify_email(email, code, atom1, atom2)

View Source

Specs

verify_email(email(), String.t(), :email, :verify) ::
  {:ok, :verify_email}
  | {:error, :verify_email, :same_code}
  | {:error, :verify_email, :data_exist, String.t()}