AshAuthentication.Phoenix.Components.Totp.Verify2faForm
(ash_authentication_phoenix v3.0.0-rc.6)
View Source
Generates a verification form for TOTP two-factor authentication.
This component supports two authentication flows:
Token-based Flow (mode: :token)
Used after primary authentication (e.g., password sign-in) when the user has TOTP enabled. The token contains partial authentication info that will be exchanged for a full session token after TOTP verification.
Step-up Authentication Flow (mode: :step_up)
Used when an already-authenticated user needs to verify their TOTP code to access protected resources. No token is required - uses the current_user from the session.
Component hierarchy
This is rendered by AshAuthentication.Phoenix.TotpVerifyLive.
Children:
AshAuthentication.Phoenix.Components.Totp.Input.code_field/1AshAuthentication.Phoenix.Components.Totp.Input.submit/1
Props
strategy- The TOTP strategy configuration. Required.mode- The verification mode::token,:step_up, or:error. Required.token- The partial authentication token (required for:tokenmode).current_user- The authenticated user (required for:step_upmode).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 rootdivelement.:slot_class- CSS class for thedivsurrounding the slot.:form_class- CSS class for theformelement.:button_text- Text for the submit button.:disable_button_text- Text for the submit button when the request is happening.:label_class- CSS class for theh2element.:label_text- Text for the form heading.:instructions_class- CSS class for instructions text.:instructions_text- Instructions text shown above the code input.:error_class- CSS class for error messages.:sign_in_link_class- CSS class for the sign-in link when not authenticated.:sign_in_link_text- Text for the sign-in link.:recovery_code_link_class- CSS class for the recovery code link.:recovery_code_link_text- Text for the link to recovery code verification (ornilto hide).:recovery_code_link_path- Path to the recovery code verification page (ornilto hide the link).
See AshAuthentication.Phoenix.Overrides for more information.
Summary
Types
@type props() :: %{ :strategy => AshAuthentication.Strategy.t(), :mode => :token | :step_up | :error, optional(:token) => String.t(), optional(:current_user) => map(), optional(:current_tenant) => String.t(), optional(:context) => map(), optional(:auth_routes_prefix) => String.t(), optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }