View Source AshAuthentication.Phoenix.Components.Password.Input (ash_authentication_phoenix v1.4.7)
Function components for dealing with form input during password authentication.
component-hierarchy
Component hierarchy
These function components are consumed by
AshAuthentication.Phoenix.Components.Password.SignInForm,
AshAuthentication.Phoenix.Components.Password.RegisterForm and
AshAuthentication.Phoenix.Components.ResetForm.
overrides
Overrides
This component provides the following overrides:
:error_li- CSS class for thelielements on error lists.:error_ul- CSS class for theulelement on error lists.:field_class- CSS class fordivelements surrounding the fields.:input_class- CSS class for text/passwordinputelements.:input_class_with_error- CSS class for text/passwordinputelements when there is a validation error.:input_debounce- Number of milliseconds to debounce input by (ornilto disable).:label_class- CSS class forlabelelements.:submit_class- CSS class for the form submitinputelement.
See AshAuthentication.Phoenix.Overrides for more information.
Link to this section 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.
Link to this section 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
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
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:textor: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
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
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
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_inor:register. Required.label- The text to show in the submit label. Generated from the configured action name (viaPhoenix.HTML.Form.humanize/1) if not supplied.overrides- A list of override modules.