feat(examples): add cross-origin host toggle to iframe-test page#136
Open
Shridhad wants to merge 1 commit into
Open
feat(examples): add cross-origin host toggle to iframe-test page#136Shridhad wants to merge 1 commit into
Shridhad wants to merge 1 commit into
Conversation
Adds a Host selector to /iframe-test so the embedded src can switch between the local app (same-origin, localhost:3000) and the deployed demo (cross-origin, https://neon-auth-nextjs-demo.vercel.app). This exercises the more realistic embedded scenario where the parent page and the embedded auth app are on different domains — widgets, multi-tenant platforms, and partner integrations. Also expands the "What to test" notes to cover the third-party cookie considerations (SameSite=None; Secure; Partitioned) that apply to cross-origin iframes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
thekauer
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #135. Adds a Host selector to
/iframe-testso the embeddedsrccan switch between:localhost:3000, the same app rendering the page (covers same-origin embedding)https://neon-auth-nextjs-demo.vercel.app, so the parent page and the embedded auth app live on different domainsThe cross-origin case is the more realistic embedded scenario — widgets, multi-tenant platforms, partner integrations, customer-facing dashboards, etc. — where most "auth in iframe" things break in subtle ways. This lets the example exercise both code paths from a single dev server.
The deployed app at
neon-auth-nextjs-demo.vercel.appdoes not setX-Frame-Optionsor aframe-ancestorsCSP (verified viacurl -I), so it embeds cleanly.@neondatabase/authalready setsSameSite=None; Secure; Partitionedproxy cookies (#132), which is what's needed for the iframe's session cookies to survive the third-party context.The "What to test" notes are expanded to call out the third-party cookie behaviour explicitly so adopters know what browser policies are at play.
Test plan
cd examples/nextjs-neon-auth && pnpm devhttp://localhost:3000/iframe-testvercel.app(Application → Cookies in DevTools)vercel.app, completes, closes, and the iframe shows the signed-in stateX-Frame-Options/ CSP errors for either host