Pow v1.0.0-rc.0 Pow.Operations View Source

Operation methods that glues operation calls to context module.

A custom context module can be used instead of the default Pow.Ecto.Context if a :users_context key is passed in the configuration.

Link to this section Summary

Functions

Authenticate a user

Build a changeset from a blank user struct

Build a changeset from existing user struct

Create a new user

Delete an existing user

Retrieve a user with the provided clauses

Update an existing user

Link to this section Functions

Link to this function authenticate(config, params) View Source
authenticate(Pow.Config.t(), map()) :: map() | nil | no_return()

Authenticate a user.

This calls Pow.Ecto.Context.authenticate/2 or authenticate/1 on a custom context module.

Link to this function changeset(config, params) View Source
changeset(Pow.Config.t(), map()) :: map() | nil | no_return()

Build a changeset from a blank user struct.

It’ll use the schema module fetched from the config through Pow.Ecto.Context.user_schema_mod/1.

Link to this function changeset(config, user, params) View Source
changeset(Pow.Config.t(), map(), map()) :: map()

Build a changeset from existing user struct.

It’ll call the changeset/2 method on the user struct.

Link to this function create(config, params) View Source
create(Pow.Config.t(), map()) :: {:ok, map()} | {:error, map()} | no_return()

Create a new user.

This calls Pow.Ecto.Context.create/2 or create/1 on a custom context module.

Link to this function delete(config, user) View Source
delete(Pow.Config.t(), map()) :: {:ok, map()} | {:error, map()} | no_return()

Delete an existing user.

This calls Pow.Ecto.Context.delete/2 or delete/1 on a custom context module.

Link to this function get_by(config, clauses) View Source
get_by(Pow.Config.t(), Keyword.t() | map()) :: map() | nil | no_return()

Retrieve a user with the provided clauses.

This calls Pow.Ecto.Context.get_by/2 or get_by/1 on a custom context module.

Link to this function update(config, user, params) View Source
update(Pow.Config.t(), map(), map()) ::
  {:ok, map()} | {:error, map()} | no_return()

Update an existing user.

This calls Pow.Ecto.Context.update/3 or update/2 on a custom context module.