View Source PowAssent.Ecto.UserIdentities.Schema behaviour (PowAssent v0.4.18)

Handles the Ecto schema for user identity.

A default changeset/2 method is created, but can be overridden with a custom changeset/2 method.

Usage

Configure lib/my_project/user_identities/user_identity.ex the following way:

defmodule MyApp.UserIdentities.UserIdentity do
  use Ecto.Schema
  use PowAssent.Ecto.UserIdentities.Schema,
    user: MyApp.Users.User

  schema "user_identities" do
    pow_assent_user_identity_fields()

    timestamps()
  end

  def changeset(user_identity_or_changeset, attrs) do
    pow_assent_changeset(user_identity_or_changeset, attrs)
  end
end

Configuration options

  • :user - the user schema module to use in the belongs_to association.

Summary

Functions

Macro for adding user identity schema fields.

Callbacks

@callback changeset(Ecto.Schema.t() | Ecto.Changeset.t(), map()) :: Ecto.Changeset.t()

Functions

Link to this function

changeset(user_identity_or_changeset, params, config)

View Source

Validates a user identity.

Link to this macro

pow_assent_user_identity_fields()

View Source (macro)
@spec pow_assent_user_identity_fields() :: Macro.t()

Macro for adding user identity schema fields.