View Source PowAssent.Operations (PowAssent v0.4.18)

Operation methods that glues operation calls to context module.

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

Summary

Functions

Lists all user identity associations for user.

Creates user with user identity with the provided user params.

Deletes the user identity for user and strategy provider name.

Retrieve a user with the strategy provider name and uid.

Upserts user identity for the user, and strategy provider name and uid.

Build a changeset from a blank user struct.

Functions

@spec all(map(), PowAssent.Config.t()) :: [map()] | no_return()

Lists all user identity associations for user.

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

Link to this function

create_user(user_identity_params, user_params, user_id_params, config)

View Source
@spec create_user(map(), map(), map() | nil, PowAssent.Config.t()) ::
  {:ok, map()}
  | {:error, {:bound_to_different_user | :invalid_user_id_field, map()}}
  | {:error, map()}
  | no_return()

Creates user with user identity with the provided user params.

This calls Pow.Ecto.UserIdentities.Context.create_user/4 or create_user/3 on a custom context module.

Link to this function

delete(user, provider, config)

View Source
@spec delete(map(), binary(), PowAssent.Config.t()) ::
  {:ok, {number(), nil}} | {:error, {:no_password, map()}} | no_return()

Deletes the user identity for user and strategy provider name.

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

Link to this function

get_user_by_provider_uid(provider, uid, config)

View Source
@spec get_user_by_provider_uid(binary(), binary(), PowAssent.Config.t()) ::
  map() | nil | no_return()

Retrieve a user with the strategy provider name and uid.

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

Link to this function

upsert(user, user_identity_params, config)

View Source
@spec upsert(map(), map(), PowAssent.Config.t()) ::
  {:ok, map()}
  | {:error, {:bound_to_different_user, map()}}
  | {:error, map()}
  | no_return()

Upserts user identity for the user, and strategy provider name and uid.

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

Link to this function

user_identity_changeset(params, user_params, user_id_params, config)

View Source
@spec user_identity_changeset(map(), map(), map(), PowAssent.Config.t()) ::
  map() | nil

Build a changeset from a blank user struct.

It'll use the schema module fetched from the config through Pow.Config.user!/1 and call user_identity_changeset/4 on it.