Macaw.Auth.User (macaw_auth v0.4.1)

Copy Markdown View Source

The signed-in user, as every backend reports it.

  • id: the backend's id, stable for the account's life.
  • username: what the person signs in with.
  • display_name: how the app shows them.
  • roles: the roles the app's authorization reads, as strings. The library only checks membership (Macaw.Auth.Plug.require_role/2); what a role allows is the app's.
  • source: where the identity came from ("local", an LDAP source's name, an OAuth provider).
  • disabled: a disabled user has no live session.
  • second_factor: :none, :enrolled, or :required (policy demands one the user hasn't enrolled).
  • must_change_password: the next step is a password change.
  • extra: the backend's or app's own fields, untouched by the library.

Summary

Types

t()

@type t() :: %Macaw.Auth.User{
  disabled: boolean(),
  display_name: String.t() | nil,
  extra: map(),
  id: term(),
  must_change_password: boolean(),
  roles: [String.t()],
  second_factor: :none | :enrolled | :required,
  source: String.t() | nil,
  username: String.t()
}