AshAuthentication.Phoenix.Components.Password (ash_authentication_phoenix v2.12.2)
View SourceGenerates sign in, registration and reset forms for a resource.
Component hierarchy
This is the top-most strategy-specific component, nested below
AshAuthentication.Phoenix.Components.SignIn.
Children:
AshAuthentication.Phoenix.Components.Password.SignInFormAshAuthentication.Phoenix.Components.Password.RegisterFormAshAuthentication.Phoenix.Components.Password.ResetForm
Props
strategy- The strategy configuration as perAshAuthentication.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.register_extra- rendered inside the registration form with the form passed as a slot argument.reset_extra- rendered inside the reset form with the form passed as a slot argument.path- used as the base for links to other pages.reset_path- the path to use for reset links.register_path- the path to use for register links.
<.live_component
module={AshAuthentication.Phoenix.Components.Password}
strategy={AshAuthentication.Info.strategy!(Example.User, :password)}
id="user-with-password"
socket={@socket}
overrides={[AshAuthentication.Phoenix.Overrides.Default]}>
<:sign_in_extra :let={form}>
<.input field={form[:capcha]} />
</:sign_in_extra>
<:register_extra :let={form}>
<.input field={form[:name]} />
</:register_extra>
<:reset_extra :let={form}>
<.input field={form[:capcha]} />
</:reset_extra>
</.live_component>Overrides
This component provides the following overrides:
:root_class- CSS class for the rootdivelement.:hide_class- CSS class to apply to hide an element.:show_first- The form to show on first load. Either:sign_inor:register. Only relevant if paths aren't set for them in the router.:interstitial_class- CSS class for thedivelement between the form and the button.:sign_in_toggle_text- Toggle text to display when the sign in form is not showing (ornilto disable).:register_toggle_text- Toggle text to display when the register form is not showing (ornilto disable).:reset_toggle_text- Toggle text to display when the reset form is not showing (ornilto disable).:toggler_class- CSS class for the toggleraelement.:register_form_module- The Phoenix component to be used for the registration form. Defaults toAshAuthentication.Phoenix.Components.Password.RegisterForm.:sign_in_form_module- The Phoenix component to be used for the sign in form. Defaults toAshAuthentication.Phoenix.Components.Password.SignInForm.:reset_form_module- The Phoenix component to be used for the reset form. Defaults toAshAuthentication.Phoenix.Components.Password.ResetForm.:slot_class- CSS class for thedivsurrounding the slot.
See AshAuthentication.Phoenix.Overrides for more information.