Skip to content

fix: lock the demo widget to the scanned domain and surface the cloudflare one-click path - #131

Merged
iagodahlem merged 1 commit into
mainfrom
iago/demo-widget-polish
Jul 26, 2026
Merged

fix: lock the demo widget to the scanned domain and surface the cloudflare one-click path#131
iagodahlem merged 1 commit into
mainfrom
iago/demo-widget-polish

Conversation

@iagodahlem

Copy link
Copy Markdown
Owner

Fixes two things the product owner hit while running the live demo against a real domain. Both are contained to the demo consumer app — the published @domainproof/react/@domainproof/ui packages and the API are untouched.

Lock the widget to the scanned domain: removed the "Verify a different domain instead" / "Back to {domain}" toggle from the embedded widget, since letting a demo visitor claim an arbitrary domain through the embedded widget was never the point — the demo is about the domain you just scanned.
Kept the sessionToken-only fallback branch: traced frontendToken/sessionToken back through claim/route.ts and status/route.ts — a claim itself always succeeds by the time the response is built (any real claim failure returns an error before either token is minted), but frontendToken extraction from verificationUrl is defensive and documented as returning null if that URL is ever shaped unexpectedly, while sessionToken is minted independently in parallel. So the sessionToken-only render state is real, just reachable through that edge case rather than "claim creation failed" outright — kept it working as a fallback, only removing its now-orphaned toggle button. Nothing downstream became dead code: componentSessions.create (server) and the widget's sessionToken prop (client) both stay in active use.
Surface the Cloudflare one-click path from the demo: the hosted verification page can add the DNS record automatically for Cloudflare-managed domains; the embedded widget deliberately doesn't carry that flow. Added a small hint line under the widget — shown only once the bound claim's provider reads back as cloudflare and only before it verifies — linking out to the hosted page (target="_blank") to finish there. The provider read is a single client-side GET to the frontend plane (same endpoint the hosted page's own poll uses, same frontendApiBaseUrl() used everywhere else in this file), fired once when frontendToken binds — no additional polling. Hiding it once verified reuses the widget's existing onVerified callback rather than adding new state or a second poll.
Tests: added a colocated verify-gate.test.tsx covering both changes — no switch-domain affordance in either widget branch, the Cloudflare hint appearing only for provider: 'cloudflare', staying hidden for other providers, and disappearing once the widget reports verified.

@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
domainproof Ready Ready Preview, Comment Jul 26, 2026 1:32am

Request Review

@iagodahlem
iagodahlem merged commit 7d47506 into main Jul 26, 2026
3 checks passed
@iagodahlem
iagodahlem deleted the iago/demo-widget-polish branch July 26, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant