View Source AshAuthentication.Phoenix.Components.Password (ash_authentication_phoenix v2.4.2)
Generates 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.SignInForm
AshAuthentication.Phoenix.Components.Password.RegisterForm
AshAuthentication.Phoenix.Components.Password.ResetForm
Props
strategy
- The strategy configuration as perAshAuthentication.Info.strategy/2
. Required.overrides
- A list of override modules.
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 rootdiv
element.:hide_class
- CSS class to apply to hide an element.:show_first
- The form to show on first load. Either:sign_in
or:register
. Only relevant if paths aren't set for them in the router.:interstitial_class
- CSS class for thediv
element between the form and the button.:sign_in_toggle_text
- Toggle text to display when the sign in form is not showing (ornil
to disable).:register_toggle_text
- Toggle text to display when the register form is not showing (ornil
to disable).:reset_toggle_text
- Toggle text to display when the reset form is not showing (ornil
to disable).:toggler_class
- CSS class for the togglera
element.:slot_class
- CSS class for thediv
surrounding the slot.
See AshAuthentication.Phoenix.Overrides
for more information.
Summary
Types
@type props() :: %{ :strategy => AshAuthentication.Strategy.t(), optional(:overrides) => [module()], optional(:live_action) => :sign_in | :register, optional(:path) => String.t(), optional(:current_tenant) => String.t(), optional(:context) => map() }