Aura.Users (Aura v0.9.1)

View Source

Service module for interacting with a Aura.Model.HexUser

Summary

Functions

Returns a Aura.Model.HexUser representing the authenticated requester

Returns a Aura.Model.HexUser, given their username_or_email

Resets a specified user's password

Returns a stream of Aura.Model.HexAuditLog, scoped to the authenticated requester

Functions

create_user(username, password, email, opts \\ [])

@spec create_user(
  username :: Aura.Common.username(),
  password :: String.t(),
  email :: Aura.Common.email(),
  opts :: list()
) :: {:ok, Aura.Model.HexUser.t()} | {:error, any()}

Requests a Hex user be created

get_current_user(opts \\ [])

@spec get_current_user(opts :: list()) ::
  {:ok, Aura.Model.HexUser.t()} | {:error, any()}

Returns a Aura.Model.HexUser representing the authenticated requester

get_user(username_or_email, opts \\ [])

@spec get_user(
  username_or_email :: Aura.Common.username() | Aura.Common.email(),
  opts :: list()
) :: {:ok, Aura.Model.HexUser.t()} | {:error, any()}

Returns a Aura.Model.HexUser, given their username_or_email

reset_user_password(username_or_email, opts \\ [])

@spec reset_user_password(
  username_or_email :: Aura.Common.username() | Aura.Common.email(),
  opts :: list()
) :: :ok | {:error, any()}

Resets a specified user's password

stream_audit_logs(opts \\ [])

@spec stream_audit_logs(opts :: list()) :: Enumerable.t()

Returns a stream of Aura.Model.HexAuditLog, scoped to the authenticated requester