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

View Source

Generates the form for verifying an OTP code (step two of the OTP flow).

The form posts directly to the strategy's sign-in endpoint via phx-trigger-action so the JWT lands in the session through the standard AuthController pipeline.

Component hierarchy

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

Children:

Props

  • strategy - The OTP strategy configuration. Required.
  • identity - The identity value (e.g. email address) submitted in the request phase. Pre-filled into a hidden field on the verify form. Required.
  • parent_id - The ID of the parent Components.Otp LiveComponent. Required.
  • auth_routes_prefix - Optional prefix for authentication routes.
  • 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.
  • :description_class - CSS class for the description paragraph.
  • :description_text - Text shown above the OTP code field, e.g. "Enter the code we sent you.". Set to nil to disable.
  • :back_link_class - CSS class for the back link.
  • :back_link_text - Text for the link that returns to the request form. Set to nil to disable.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Types

props()

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