PowAssent v0.4.5 PowAssent.Phoenix.ViewHelpers View Source

View helpers to render authorization links.

Link to this section Summary

Functions

Generates an authorization link for a provider.

Generates a provider deauthorization link.

Generates list of authorization links for all configured providers.

Link to this section Functions

Link to this function

authorization_link(conn, provider, opts \\ [])

View Source
authorization_link(Conn.t(), atom(), keyword()) :: Phoenix.HTML.safe()

Generates an authorization link for a provider.

The link is used to sign up or register a user using a provider. If :invited_user is assigned to the conn, the invitation token will be passed on through the URL query params.

Link to this function

deauthorization_link(conn, provider, opts \\ [])

View Source
deauthorization_link(Conn.t(), atom(), keyword()) :: Phoenix.HTML.safe()

Generates a provider deauthorization link.

The link is used to remove authorization with the provider.

Link to this function

provider_links(conn, link_opts \\ [])

View Source
provider_links(Conn.t(), keyword()) :: [Phoenix.HTML.safe()]

Generates list of authorization links for all configured providers.

The list of providers will be fetched from the configuration, and authorization_link/2 will be called on each.

If a user is assigned to the conn, the authorized providers for a user will be looked up with PowAssent.Plug.providers_for_current_user/1. deauthorization_link/2 will be used for any already authorized providers.