AshAuthentication.Phoenix.Components.Otp
(ash_authentication_phoenix v3.0.0-rc.6)
View Source
Generates a sign-in form for the OTP strategy.
The OTP flow is two steps on the same page:
- The user submits their identity (e.g. email). The strategy fires the configured sender, which delivers a short code out-of-band.
- The user enters the code they received and submits. This component
posts the code to the strategy's sign-in endpoint via
phx-trigger-action, so the JWT lands in the session through the standardAuthControllerpipeline.
Component hierarchy
This is the top-most strategy-specific component for OTP, nested below
AshAuthentication.Phoenix.Components.SignIn.
Children:
AshAuthentication.Phoenix.Components.Otp.RequestFormAshAuthentication.Phoenix.Components.Otp.VerifyForm
Props
strategy- The OTP strategy configuration as perAshAuthentication.Info.strategy/2. Required.auth_routes_prefix- Optional prefix for authentication routes.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.:request_form_module- The Phoenix component used for the request (step one) form. Defaults toAshAuthentication.Phoenix.Components.Otp.RequestForm.:verify_form_module- The Phoenix component used for the verify (step two) form. Defaults toAshAuthentication.Phoenix.Components.Otp.VerifyForm.
See AshAuthentication.Phoenix.Overrides for more information.