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

View Source

Generates the form for requesting an OTP code (step one of the OTP flow).

On successful submission this component runs the request action server-side (which fires the configured sender) and notifies the parent AshAuthentication.Phoenix.Components.Otp component to advance to the verify phase.

Component hierarchy

This is a child of AshAuthentication.Phoenix.Components.Otp.

Children:

Props

  • strategy - The OTP strategy configuration. Required.
  • parent_id - The ID of the parent Components.Otp LiveComponent. Required (used for send_update).
  • label - Text to show in the h2 heading. false to disable.
  • overrides - A list of override modules.
  • gettext_fn - Optional text translation function.

Overrides

This component provides the following overrides:

  • :root_class - CSS class for the root div element.
  • :form_class - CSS class for the form element.
  • :disable_button_text - Text for the submit button when the request is happening.
  • :label_class - CSS class for the h2 element.
  • :request_flash_text - Text for the flash message shown after the OTP request is submitted. Set to nil to disable.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Types

props()

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