You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a full-viewport /creator-contest route on peanut.me that embeds the independently deployed contest
reserve the route so the recipient catch-all cannot intercept it
allow the contest origin in the report-only frame-src policy
delegate the storage-access Permissions Policy required by the child fallback flow
cover the iframe URL and security attributes with a unit test
The contest remains on its existing Vercel deployment, so this needs no DNS migration and does not couple its release cycle to peanut-ui.
Merge blocker: freelancer handoff
Keep this PR in draft until the child app is updated and the authenticated flow passes in the embed. The unauthenticated page already renders; the session behavior is the blocker.
Send this HTTP header on every contest HTML route: Content-Security-Policy: frame-ancestors 'self' https://peanut.me
Merge it into any existing CSP. Do not use a meta tag, and do not add X-Frame-Options: SAMEORIGIN or DENY. Add only exact preview/test parent origins in non-production environments.
Make the session cookie host-only and iframe-safe: HttpOnly; Secure; SameSite=None; Partitioned; Path=/
Prefer a __Host- cookie name. Set and clear it with the same attributes, and rotate it on login.
Re-check authorization on every mutation. For custom mutating route handlers, validate Origin or a CSRF token because SameSite=None removes the usual SameSite CSRF defense. Do not put auth tokens in postMessage or localStorage. A direct iframe keeps Server Action requests on the child origin, so do not add peanut.me or a wildcard to serverActions.allowedOrigins.
Add a user-gesture Storage Access API path plus a clear “Open contest in a new tab” fallback for browsers that deny embedded storage. The parent sandbox already grants scripts, forms, same-origin, popups, and storage access by user activation.
Test inside https://peanut.me/creator-contest: home → signup/login → dashboard → reload → logout, including Chrome, Firefox, Safari/private mode, and third-party-cookie blocking. Also verify an unrelated origin cannot frame the app.
No CORS or DNS change is required for this direct iframe setup. The freelancer source repo was not found among accessible Peanut or personal repositories, so that child-side patch needs repo access or a transfer into the Peanut organization.
Adds a non-indexed /creator-contest page that embeds the Peanut contest site in a full-screen sandboxed iframe. Registers the route and permits the contest origin in the report-only CSP frame-src directive. Tests verify the iframe attributes.
Changes
Creator contest page
Layer / File(s)
Summary
Contest page and iframe contract src/app/creator-contest/page.tsx, src/app/creator-contest/__tests__/page.test.tsx
Adds SEO metadata and a full-screen sandboxed iframe for the Peanut contest site. Tests verify its title, URL, sandbox permissions, and referrer policy.
Route registration and CSP allowlist src/constants/routes.ts, next.config.js
Adds creator-contest to the dedicated routes and allows the contest origin in the report-only frame-src directive.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
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
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
/creator-contestroute on peanut.me that embeds the independently deployed contestframe-srcpolicystorage-accessPermissions Policy required by the child fallback flowThe contest remains on its existing Vercel deployment, so this needs no DNS migration and does not couple its release cycle to peanut-ui.
Merge blocker: freelancer handoff
Keep this PR in draft until the child app is updated and the authenticated flow passes in the embed. The unauthenticated page already renders; the session behavior is the blocker.
Content-Security-Policy: frame-ancestors 'self' https://peanut.meMerge it into any existing CSP. Do not use a meta tag, and do not add
X-Frame-Options: SAMEORIGINorDENY. Add only exact preview/test parent origins in non-production environments.HttpOnly; Secure; SameSite=None; Partitioned; Path=/Prefer a
__Host-cookie name. Set and clear it with the same attributes, and rotate it on login.Originor a CSRF token becauseSameSite=Noneremoves the usual SameSite CSRF defense. Do not put auth tokens inpostMessageor localStorage. A direct iframe keeps Server Action requests on the child origin, so do not addpeanut.meor a wildcard toserverActions.allowedOrigins.https://peanut.me/creator-contest: home → signup/login → dashboard → reload → logout, including Chrome, Firefox, Safari/private mode, and third-party-cookie blocking. Also verify an unrelated origin cannot frame the app.No CORS or DNS change is required for this direct iframe setup. The freelancer source repo was not found among accessible Peanut or personal repositories, so that child-side patch needs repo access or a transfer into the Peanut organization.
Verification
/creator-contestreturns 200 and loads the child frame with no child-origin request failuresScreenshot
375 × 667 local preview. The small Next.js development indicator in the lower-left is not present in production.
Summary by CodeRabbit