authority v0.3.0 Authority.Recovery behaviour

A minimal behaviour for recovering a user account.

Example

If your id is an email address, your Recovery module might look something like this:

defmodule MyApp.Accounts.Recovery do
  use Authority.Recovery

  @impl Authority.Recovery
  def recover(email) do
    # Send a password reset email to the user
  end
end

Link to this section Summary

Types

An identifier representing a user, such as an email address

Callbacks

Initiates an account recovery process for the user associated with the identifier, however that looks for your application

Link to this section Types

Link to this type id()
id() :: any()

An identifier representing a user, such as an email address.

Link to this section Callbacks

Link to this callback recover(id)
recover(id()) :: :ok | {:error, term()}

Initiates an account recovery process for the user associated with the identifier, however that looks for your application.