View Source Bonfire.Data.Identity.Email (Bonfire v0.9.11-social-beta.6)

Summary

Functions

Options: email_regex: Regexp.t (default very minimal validation) must_confirm?: bool (default true)

Changeset function. Marks the user's email as confirmed and removes their confirmation token.

Checks whether the user should be able to request a confirm email

Changeset function. Unconditionally sets the user as unconfirmed, generates a confirmation token and puts an expiry on it determined by the :confirm_duration config key (default one day).

Checks whether the user should request a new confirmation token or refresh it

Types

t()

@type t() :: %Bonfire.Data.Identity.Email{
  __meta__: Ecto.Schema.Metadata.t(),
  account: Ecto.Schema.belongs_to(Bonfire.Data.Identity.Account.t()) | nil,
  confirm_token: term(),
  confirm_until: term(),
  confirmed_at: term(),
  email_address: term(),
  id: Needle.UID.t() | nil,
  pointer: Ecto.Schema.belongs_to(Needle.Pointer.t()) | nil
}

Functions

changeset(email \\ %Email{}, params, opts \\ [])

Options: email_regex: Regexp.t (default very minimal validation) must_confirm?: bool (default true)

confirm(email)

Changeset function. Marks the user's email as confirmed and removes their confirmation token.

delete(struct, key)

get(struct, key, default \\ nil)

may_confirm?(email, opts \\ [])

may_request_confirm_email?(email, opts \\ [])

Checks whether the user should be able to request a confirm email

put(struct, key, val)

put_token(email)

Changeset function. Unconditionally sets the user as unconfirmed, generates a confirmation token and puts an expiry on it determined by the :confirm_duration config key (default one day).

should_request_or_refresh?(email, opts \\ [])

Checks whether the user should request a new confirmation token or refresh it