View Source AshAuthentication.Phoenix.Components.Helpers (ash_authentication_phoenix v2.0.0)

Helpers which are commonly needed inside the various components.

Summary

Functions

The LiveView Socket contains a reference to the Phoenix endpoint, and from there we can extract the otp_app of the current request.

The LiveView Socket contains a refererence to the Phoenix router, and from there we can generate the name of the route helpers module.

Functions

Link to this function

otp_app_from_socket(socket)

View Source
@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 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.