Skip to content

An embedded signup forgets who signed up in that browser #1065

Open

Description

@richshaw

Needs your OK: this adds a cookie so an embedded signup can show people their own sign-ups, and changes the cookies page. Swap pipeline:proposed for pipeline:ready to have it built.

Part of #1061.

What happens

On /s/[slug], the os_commit cookie remembers this browser's sign-ups, so the page shows "you're signed up" with an Edit link. Inside another website's frame (#1062), the cookie is SameSite=Lax (setReturningCommitCookie in src/lib/returning-participant.ts), so the browser neither keeps nor sends it. Someone who signed up through an embed sees the sheet as though they never had. Their way back is the edit link in their confirmation email, and on a signup that doesn't ask for an email (requireEmail off), only the link the success view showed them once. #657 is about that wider problem.

Fix, in outline

  • A second cookie, for the embed only, set SameSite=None; Secure; Partitioned. The browser keeps it only for OpenSignup inside that one website, so it can't follow anyone from site to site.
  • The embed's sign-up says it's from the embed (a field in the request, say embed: true), and the sign-up API then sets the partitioned cookie alongside the usual one.
  • The embed page reads both cookies. The normal page and its cookie don't change.
  • HTTPS instances only. SameSite=None and Partitioned both need Secure, which isHttpsDeployment() leaves off on plain-HTTP instances. There the embed carries on without it.

Watch for

  • Who reads the cookie. Checked at 0a71fbf: only the signup page (src/app/s/[slug]/page.tsx) reads it. The API routes only rewrite it, and changing or cancelling a sign-up (PATCH and DELETE /api/commitments/[id]) is authorized by the edit token in ?token= or x-edit-token, never by the cookie. Keep it that way: a SameSite=None cookie travels with requests the host website makes to OpenSignup.
  • Changes made on the edit page. It opens in a new top-level tab, which can't write the embed's partitioned cookie. Old entries are harmless, because getOwnCommitmentsForSignup keeps only active sign-ups whose token matches, but a slot moved on the edit page won't show as yours in the embed.
  • Safari handles partitioned cookies differently from Chrome. Check it by hand, and accept the email link as the fallback there.
  • Legal pages. The cookies page lists each cookie and its attributes, and the privacy page says what's stored. Update both and bump "Last updated", as CLAUDE.md asks of any cookie change.
  • One expiry rule. Reuse cookieMaxAge and rememberUntil rather than a second copy.
  • CHANGELOG: an entry for the new cookie.

Choices this makes

Order

After #1062, because it changes the embed page #1062 adds.

Done when

  • Unit tests pin the new cookie's attributes, and the existing test that os_commit is always httpOnly and sameSite: 'lax' (returning-participant.test.ts) still passes.
  • On an HTTPS instance, in Chrome, signing up inside an embed and reloading the host page shows "you're signed up". The Playwright projects are chromium, mobile-safari and chromium-phone, and the e2e server runs on plain HTTP, so either the spec gets an HTTPS server or the PR records a check by hand.
  • The cookies and privacy pages describe the new cookie.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test, pnpm test:db and the e2e suite pass.

From the owner's notes, checked against main at 0a71fbf, and reviewed by a second agent against the code. https://claude.ai/code/session_016YZ9SSL4C6UVyX63KaR1bL

Activity

  1. added
    pipeline:ux
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpipeline:proposedpipeline:ux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions