Lockspire.Web.ConsentContext (lockspire v1.6.1)

Copy Markdown

Prepares the small, redaction-safe render context for a host-owned consent page.

Host LiveViews call load/2 with their current connection or socket and the interaction identifier from the route. Lockspire performs the authoritative interaction lookup, account resolution, subject binding, expiration checks, and remembered-consent transition before returning decision-capable facts.

The returned context deliberately excludes repository records, account and interaction identifiers, redirect URIs, raw authorization details, tokens, and protocol errors. A redirect result is terminal and must be performed without rendering its destination.

Summary

Types

error_reason()

@type error_reason() :: :not_found | :expired | :subject_mismatch | :unavailable

render_context()

@type render_context() :: %{
  page_title: String.t(),
  client_name: String.t() | nil,
  requested_scopes: [String.t()],
  authorization_detail_types: [String.t()],
  remember?: boolean(),
  finalize_path: String.t()
}

Functions

load(conn_or_socket, interaction_id)

@spec load(Plug.Conn.t() | Phoenix.LiveView.Socket.t() | term(), String.t()) ::
  {:ok, render_context()} | {:redirect, String.t()} | {:error, error_reason()}