AshAuthentication.Phoenix.Components.MagicLink.Input (ash_authentication_phoenix v2.13.1)

View Source

Function components for dealing with form input during magic link sign in.

Component hierarchy

These function components are consumed by AshAuthentication.Phoenix.Components.MagicLink.Form

Overrides

This component provides the following overrides:

  • :submit_label - A function that takes the strategy and returns text for the sign in button, or a string.
  • :submit_class - CSS class for the form submit input element.
  • :checkbox_class - CSS class for the input element of the remember me field.
  • :checkbox_label_class - CSS class for the label element of the remember me field.
  • :remember_me_class - CSS class for the div element surrounding the remember me field.
  • :input_debounce - Number of milliseconds to debounce input by (or nil to disable).
  • :remember_me_input_label - Label for remember me field.

See AshAuthentication.Phoenix.Overrides for more information.

Summary

Functions

Generate a form field for the remember me field.

Generate an form submit button.

Functions

remember_me_field(assigns)

@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 per AshAuthentication.authenticated_resources/1. Required.
  • form - An AshPhoenix.Form. Required.
  • name - The name of the field. Defaults to :remember_me.
  • overrides - A list of override modules.
  • gettext_fn - Optional text translation function.

submit(assigns)

@spec submit(%{
  :socket => Phoenix.LiveView.Socket.t(),
  :form => AshPhoenix.Form.t(),
  optional(:submit_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 per AshAuthentication.authenticated_resources/1. Required.
  • form - An AshPhoenix.Form. Required.
  • submit_label - The text to show in the submit label.
  • overrides - A list of override modules.
  • gettext_fn - Optional text translation function.