AshAuthentication.Phoenix.Components.Totp (ash_authentication_phoenix v3.0.0-rc.6)

View Source

Generates sign in and setup forms for TOTP authentication.

Component hierarchy

This is the top-most strategy-specific component for TOTP, nested below AshAuthentication.Phoenix.Components.SignIn.

Children:

Props

  • strategy - The strategy configuration as per AshAuthentication.Info.strategy/2. Required.
  • overrides - A list of override modules.
  • gettext_fn - Optional text translation function.

Slots

  • sign_in_extra - rendered inside the sign-in form with the form passed as a slot argument.
  • setup_extra - rendered inside the setup form with the form passed as a slot argument.

Overrides

This component provides the following overrides:

  • :root_class - CSS class for the root div element.
  • :hide_class - CSS class to apply to hide an element.
  • :show_first - The form to show on first load. Either :sign_in or :setup. Defaults to :sign_in.
  • :interstitial_class - CSS class for the div element between the form and the toggle.
  • :sign_in_toggle_text - Toggle text to display when the sign in form is not showing (or nil to disable).
  • :toggler_class - CSS class for the toggler a element.
  • :sign_in_form_module - The Phoenix component to be used for the sign in form. Defaults to AshAuthentication.Phoenix.Components.Totp.SignInForm.
  • :slot_class - CSS class for the div surrounding the slot.
  • :setup_toggle_text - Toggle text to display when the setup form is not showing (or nil to disable).
  • :setup_form_module - The Phoenix component to be used for the setup form. Defaults to AshAuthentication.Phoenix.Components.Totp.SetupForm.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Types

props()

@type props() :: %{
  :strategy => AshAuthentication.Strategy.t(),
  optional(:live_action) => :sign_in | :setup,
  optional(:path) => String.t(),
  optional(:current_tenant) => String.t(),
  optional(:context) => map(),
  optional(:overrides) => [module()],
  optional(:gettext_fn) => {module(), atom()}
}