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

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

auth_path(socket, subject_name, auth_routes_prefix, strategy, phase, params \\ %{})

otp_app_from_socket(socket)

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

route_helpers(socket)

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