AshAuthentication.Phoenix.Components.Password.Input (ash_authentication_phoenix v2.12.1)
View SourceFunction 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 forlabelelements.:submit_class- CSS class for the form submitinputelement.:field_class- CSS class fordivelements surrounding the fields.:input_class- CSS class for text/passwordinputelements.: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/passwordinputelements when there is a validation error.:error_ul- CSS class for theulelement on error lists.:error_li- CSS class for thelielements on error lists.:input_debounce- Number of milliseconds to debounce input by (ornilto disable).:remember_me_class- CSS class for thedivelement surrounding the remember me field.:remember_me_input_label- Label for remember me field.:checkbox_class- CSS class for theinputelement of the remember me field.:checkbox_label_class- CSS class for thelabelelement of the remember me field.
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 a form field for the remember me 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()}], optional(:gettext_fn) => {module(), atom()} }) :: 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.gettext_fn- Optional text translation function.
@spec identity_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:input_type) => :text | :email, optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }) :: 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:textor:email. If not set it will try and guess based on the name of the identity field.overrides- A list of override modules.gettext_fn- Optional text translation function.
@spec password_confirmation_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }) :: 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.gettext_fn- Optional text translation function.
@spec password_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }) :: 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.gettext_fn- Optional text translation function.
@spec remember_me_field(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), optional(:name) => atom(), optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }) :: Phoenix.LiveView.Rendered.t() | no_return()
Generate a form field for the remember me 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.name- The name of the field. Defaults to:remember_me.overrides- A list of override modules.gettext_fn- Optional text translation function.
@spec submit(%{ :socket => Phoenix.LiveView.Socket.t(), :strategy => AshAuthentication.Strategy.t(), :form => AshPhoenix.Form.t(), :action => :sign_in | :register | :request_reset | :reset, optional(:label) => String.t(), optional(:overrides) => [module()], optional(:gettext_fn) => {module(), atom()} }) :: 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,:register,:request_resetor:reset. 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.gettext_fn- Optional text translation function.