View Source ExTeal.AuthProvider behaviour (ExTeal v0.28.1)

Interface for providing authorization and authentication to ExTeal.

Summary

Types

Data to be displayed on the front end

Callbacks

Used to display the current user on the nav bar.

Used to build the content of the dropdown menu for a user.

Types

@type user_payload() :: %{name: String.t() | nil, avatar_url: String.t() | nil}

Data to be displayed on the front end

Callbacks

@callback current_user_for(Plug.Conn.t()) :: user_payload()

Used to display the current user on the nav bar.

Should return a user_payload map. If your User struct does not have a user image associated with it, consider using the gravatar api.

@callback dropdown_content(Plug.Conn.t()) :: [String.t()]

Used to build the content of the dropdown menu for a user.

The content of the user dropdown is dynamic and can be overriden to provide additional links and html.

The function should return a list of strings that will be used to build list elements.