AshAuthentication.Phoenix.Components.Helpers (ash_authentication_phoenix v2.13.1)
View SourceHelpers which are commonly needed inside the various components.
Summary
Functions
Logs all form errors when debug_authentication_failures? is configured to true
The LiveView Socket contains a reference to the Phoenix endpoint, and from
there we can extract the otp_app of the current request.
Returns the name of the remember me field name if any for the given strategy.
It does this by looking for the presence of RememberMe.MaybeGenerateTokenPreparation
(for read actions) or RememberMe.MaybeGenerateTokenChange (for create actions)
and the name of the argument that it is expecting.
The LiveView Socket contains a refererence to the Phoenix router, and from
there we can generate the name of the route helpers module.
Functions
Logs all form errors when debug_authentication_failures? is configured to true
@spec otp_app_from_socket(Phoenix.LiveView.Socket.t()) :: atom()
The LiveView Socket contains a reference to the Phoenix endpoint, and from
there we can extract the otp_app of the current request.
This is pulled from assigns[:otp_app], or inferred
from the socket if that is not set.
@spec remember_me_field(AshAuthentication.Strategy.t()) :: atom() | nil
Returns the name of the remember me field name if any for the given strategy.
It does this by looking for the presence of RememberMe.MaybeGenerateTokenPreparation
(for read actions) or RememberMe.MaybeGenerateTokenChange (for create actions)
and the name of the argument that it is expecting.
@spec route_helpers(Phoenix.LiveView.Socket.t()) :: module()
The LiveView Socket contains a refererence to the Phoenix router, and from
there we can generate the name of the route helpers module.