AshAuthentication.Phoenix.RecoveryCodeDisplayLive (ash_authentication_phoenix v3.0.0-rc.6)

View Source

A generic, white-label page for generating and displaying recovery codes.

This page is used by authenticated users to generate recovery codes as a backup authentication method. It should be placed behind authentication middleware to ensure only authenticated users can access it.

Usage

Add to your router using the recovery_code_display_route/3 macro:

scope "/", MyAppWeb do
  pipe_through [:browser, :require_authenticated_user]
  recovery_code_display_route MyApp.Accounts.User, :recovery_code, auth_routes_prefix: "/auth"
end

Overrides

This component provides the following overrides:

  • :root_class - CSS class for the root div element.
  • :error_class - CSS class for error messages when unauthenticated.
  • :recovery_code_display_id - Element ID for the DisplayCodes LiveComponent.

See AshAuthentication.Phoenix.Overrides for more information.