View Source AshAuthentication.Phoenix.Components.Password.Input (ash_authentication_phoenix v2.4.4)
Function components for dealing with form input during password authentication.
Component hierarchy
These function components are consumed by
AshAuthentication.Phoenix.Components.Password.SignInForm
,
AshAuthentication.Phoenix.Components.Password.RegisterForm
and
AshAuthentication.Phoenix.Components.ResetForm
.
Overrides
This component provides the following overrides:
:label_class
- CSS class forlabel
elements.:field_class
- CSS class fordiv
elements surrounding the fields.:input_class
- CSS class for text/passwordinput
elements.:identity_input_label
- Label for identity field.:identity_input_placeholder
- Placeholder for identity field.:password_input_label
- Label for password field.:password_confirmation_input_label
- Label for password confirmation field.:input_class_with_error
- CSS class for text/passwordinput
elements when there is a validation error.:submit_class
- CSS class for the form submitinput
element.:error_ul
- CSS class for theul
element on error lists.:error_li
- CSS class for theli
elements on error lists.:input_debounce
- Number of milliseconds to debounce input by (ornil
to disable).
See AshAuthentication.Phoenix.Overrides
for more information.
Summary
Functions
Generate a list of errors for a field (if there are any).
Generate a form field for the configured identity field.
Generate a form field for the configured password confirmation entry field.
Generate a form field for the configured password entry field.
Generate an form submit button.
Functions
@spec error(%{ :socket => Phoenix.LiveView.Socket.t(), :form => AshPhoenix.Form.t(), :field => atom(), optional(:field_label) => String.Chars.t(), optional(:errors) => [{atom(), String.t()}] }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate a list of errors for a field (if there are any).
Props
socket
- Phoenix LiveView socket. This is needed to be able to retrieve the correct CSS configuration. Required.form
- AnAshPhoenix.Form
. Required.field
- The field for which to retrieve the errors. Required.overrides
- A list of override modules.
@spec identity_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:input_type) => :text | :email, optional(:overrides) => [module()] }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate a form field for the configured identity field.
Props
socket
- Phoenix LiveView socket. This is needed to be able to retrieve the correct CSS configuration. Required.strategy
- The configuration map as perAshAuthentication.authenticated_resources/1
. Required.form
- AnAshPhoenix.Form
. Required.input_type
- Either:text
or:email
. If not set it will try and guess based on the name of the identity field.overrides
- A list of override modules.
@spec password_confirmation_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:overrides) => [module()] }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate a form field for the configured password confirmation entry field.
Props
socket
- Phoenix LiveView socket. This is needed to be able to retrieve the correct CSS configuration. Required.strategy
- The configuration map as perAshAuthentication.authenticated_resources/1
. Required.form
- AnAshPhoenix.Form
. Required.overrides
- A list of override modules.
@spec password_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:overrides) => [module()] }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate a form field for the configured password entry field.
Props
socket
- Phoenix LiveView socket. This is needed to be able to retrieve the correct CSS configuration. Required.strategy
- The configuration map as perAshAuthentication.authenticated_resources/1
. Required.form
- AnAshPhoenix.Form
. Required.overrides
- A list of override modules.
@spec submit(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), :action => :sign_in | :register, optional(:label) => String.t(), optional(:overrides) => [module()] }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate an form submit button.
Props
socket
- Phoenix LiveView socket. This is needed to be able to retrieve the correct CSS configuration. Required.strategy
- The configuration map as perAshAuthentication.authenticated_resources/1
. Required.form
- AnAshPhoenix.Form
. Required.action
- Either:sign_in
or:register
. Required.label
- The text to show in the submit label. Generated from the configured action name (viaPhoenix.Naming.humanize/1
) if not supplied.overrides
- A list of override modules.