AccrueAdmin.StepUp (accrue_admin v0.3.0)

Copy Markdown View Source

Shared admin step-up workflow for destructive LiveView actions.

The service keeps a per-LiveView grace window in assigns, delegates the actual challenge/verification work to Accrue.Auth, and records admin.step_up.* audit rows through the core event ledger.

Summary

Types

continuation()

@type continuation() :: (Phoenix.LiveView.Socket.t() -> Phoenix.LiveView.Socket.t())

Functions

fresh?(socket, opts \\ [])

@spec fresh?(
  Phoenix.LiveView.Socket.t(),
  keyword()
) :: boolean()

require_fresh(socket, action, continuation, opts \\ [])

@spec require_fresh(Phoenix.LiveView.Socket.t(), map(), continuation(), keyword()) ::
  {:ok, Phoenix.LiveView.Socket.t()}
  | {:challenge, Phoenix.LiveView.Socket.t()}
  | {:error, term(), Phoenix.LiveView.Socket.t()}

verify(socket, params, opts \\ [])