PreviewLinkController
Corex\Config\Operations\PreviewLinkController · class · Config layer
Receives an operator’s action on the preview link (spec 101, FR-011 and FR-012): one admin_post handler behind the shared {@see AdminGuard} (capability + nonce), which hands the request to {@see PreviewLinkService} and reports what it answered. It reports in one of two ways, and the difference is the point of this class. An action that made no link — a revocation, or one with nothing to do — redirects back to Operations & Security with a status, like every other form on that screen. An action that made a link answers the POST itself, with a page showing the link. It cannot redirect: the link is not stored anywhere it could be read back from (FR-013), so the one moment it exists is this response. Carrying it through a redirect would mean putting the secret in an address — and so in the browser’s history and the server’s log — or parking it in the database for the next request to collect, which is the thing the spec forbids.
Public API
Section titled “Public API”__construct(AdminGuard $guard, PreviewLinkService $links, StandalonePage $page)
Section titled “__construct(AdminGuard $guard, PreviewLinkService $links, StandalonePage $page)”register(): void
Section titled “register(): void”handle(): void
Section titled “handle(): void”linkPage(PreviewLinkResult $result): string
Section titled “linkPage(PreviewLinkResult $result): string”The page that shows a link that was just made: the whole address in a field with a button that copies it (FR-011a), what it does, and that this is the only time it will be shown.