View Source AshAuthentication.Phoenix.Overrides (ash_authentication_phoenix v1.9.4)

Behaviour for overriding component styles and attributes in your application.

The default implementation is AshAuthentication.Phoenix.Overrides.Default which uses TailwindCSS to generate a fairly generic looking user interface.

You can override this by adding your own override modules to the AshAuthentication.Phoenix.Router.sign_in_route/1 macro in your router:

sign_in_route overrides: [MyAppWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.Default]

and defining lib/my_app_web/auth_overrides.ex within which you can set any overrides.

The use macro defines overridable versions of all callbacks which return nil, so you only need to define the functions that you care about.

Each of the override modules specified in the config will be called in the order that they're specified, so you can still use the defaults if you just override some properties.

defmodule MyAppWeb.AuthOverrides do
  use AshAuthentication.Phoenix.Overrides
  alias AshAuthentication.Phoenix.Components

  override Components.Banner do
    set :image_url, "/images/sign_in_logo.png"
  end
end

Summary

Functions

Define overrides for a specific component.

Override a setting within a component.

Functions

Link to this macro

override(component, list)

View Source (macro)
@spec override(component :: module(), [{:do, Macro.t()}]) :: Macro.t()

Define overrides for a specific component.

Link to this macro

set(selector, value)

View Source (macro)
@spec set(atom(), any()) :: Macro.t()

Override a setting within a component.