Pow v0.1.0-alpha Pow.Ecto.Context behaviour View Source

Handles pow users context for user.

Usage

This module will be used by pow by default. If you wish to have control over context methods, you can do configure lib/my_project/user/users.ex the following way:

defmodule MyApp.Users do
  use Pow.Ecto.Context,
    repo: MyApp.Repo,
    user: MyApp.Users.User

  def create(params) do
    pow_create(params)
  end
end

Remember to update configuration with users_context: MyApp.Users.

The following Pow methods can be accessed:

  • pow_authenticate/1
  • pow_create/1
  • pow_update/2
  • pow_delete/1
  • pow_get_by/1

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function authenticate(config, params) View Source
authenticate(Pow.Config.t(), map()) :: user() | nil
Link to this function create(config, params) View Source
create(Pow.Config.t(), map()) :: {:ok, user()} | {:error, Ecto.Changeset.t()}
Link to this function delete(config, user) View Source
delete(Pow.Config.t(), user()) :: {:ok, user()} | {:error, Ecto.Changeset.t()}
Link to this function get_by(config, clauses) View Source
get_by(Pow.Config.t(), Keyword.t() | map()) :: user() | nil
Link to this function update(config, user, params) View Source
update(Pow.Config.t(), user(), map()) ::
  {:ok, user()} | {:error, Ecto.Changeset.t()}
Link to this function user_schema_mod(config) View Source
user_schema_mod(Pow.Config.t()) :: atom() | no_return()

Link to this section Callbacks

Link to this callback authenticate(map) View Source
authenticate(map()) :: user() | nil
Link to this callback create(map) View Source
create(map()) :: {:ok, user()} | {:error, Ecto.Changeset.t()}
Link to this callback delete(user) View Source
delete(user()) :: {:ok, user()} | {:error, Ecto.Changeset.t()}
Link to this callback get_by(arg0) View Source
get_by(Keyword.t() | map()) :: user() | nil
Link to this callback update(user, map) View Source
update(user(), map()) :: {:ok, user()} | {:error, Ecto.Changeset.t()}