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:

Props

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 root div 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 the div element between the form and the button.
  • :sign_in_toggle_text - Toggle text to display when the sign in form is not showing (or nil to disable).
  • :register_toggle_text - Toggle text to display when the register form is not showing (or nil to disable).
  • :reset_toggle_text - Toggle text to display when the reset form is not showing (or nil to disable).
  • :toggler_class - CSS class for the toggler a element.
  • :slot_class - CSS class for the div surrounding the slot.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Types

props()

@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()
}