authex v0.1.2 Authex.Checker behaviour View Source

Link to this section Summary

Functions

Runs an Authex.Verification struct through the default checker module

Runs an Authex.Verification struct through the specified checker module

Link to this section Functions

Link to this function run(verification) View Source
run(Authex.Verification.t()) ::
  {:ok, Authex.Token.t()} |
  {:error, atom()}

Runs an Authex.Verification struct through the default checker module.

Parameters

  • verification: An Authex.Verification struct.

Examples

iex> {:ok, token} = [sub: 1]
...> |> Authex.token()
...> |> Authex.sign()
...> |> Authex.Verification.new()
...> |> Authex.Checker.run()
iex> with %Authex.Token{sub: sub} <- token, do: sub
1
Link to this function run(checker, verification) View Source
run(atom(), Authex.Verification.t()) ::
  {:ok, Authex.Token.t()} |
  {:error, atom()}

Runs an Authex.Verification struct through the specified checker module.

Parameters

  • checker: A checker module.
  • verification: An Authex.Verification struct.

Link to this section Callbacks

Link to this callback handle_run(arg0) View Source
handle_run(Authex.Verification.t()) :: term() | :error