Skip to content

Run the production handshake leg once against a live Clerk instance #128

Closed

Description

@allisonmahmood

Question

The login door end to end on the development instance reproduced the production-shaped handshake return leg only offline, with a fake pk_live_ key. One run against a real production Clerk instance confirms the return leg, the cookie Domain on the production Frontend API CNAME, and whether FAPI honours format=nonce there. Decided on The login door on a tier 0 page: filed here rather than on the deployment effort, to run after auth is built and the deployment has a domain. Resolved by a comment recording what was observed and any door change it forces.

Activity

  1. added
    wayfinder:task
    on Sep 3, 2026
  2. allisonmahmood commented on Sep 6, 2026

    @allisonmahmood
    OwnerAuthor

    Environment check, 2026-09-06: this verification remains blocked on a production Clerk instance and the deployment's domain.

    • The two native implementation dependencies, Write the auth spec and file the build tickets and feat(serving): the login door on a tier 0 page, are closed.
    • The authenticated Clerk CLI's application list shows only development instances for both patchy-cloud and patchy-cloud-ci; neither has a production instance.
    • The developer configuration uses pk_test_ / sk_test_ keys for engaging-earwig-3123.clerk.accounts.dev.
    • This checkout has no running local dev instance. Starting one with those keys would exercise the development handshake, not establish the production CNAME cookie behavior requested here.
    • The source has an offline production-shaped cookie-return test in packages/auth/src/Session.test.ts; that is not evidence from a real production instance.

    To complete this ticket, supply the deployed Patchy HTTPS origin and a configured production Clerk instance on its shared registrable domain. Then observe the signed-in cold-return redirect chain, cookie Domain attributes, whether Frontend API honors format=nonce, and whether Patchy's door accepts the return. Record cookie attributes and parameter names without credential values.

    No runtime or configuration changes made, no production handshake run, and no resolution claimed. The auth map remains open pending this verification.

  3. allisonmahmood commented on Sep 6, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Closed with Allison's explicit scope adjustment: verify what is possible against the live development Clerk instance and record that no production deployment exists yet. This closure does not certify the production handshake.

    Verified checkout 1f3f518dd4a2c5864a4c94caaa7af1ac7d69fbbb against the real patchy-cloud development application (engaging-earwig-3123.clerk.accounts.dev), using the existing browser suite's isolated local server and database. Command: pnpm test:clerk --browser, with a temporary observation spec that recorded only redirect origins/paths, query parameter names, and cookie attributes. No cookie, session, or testing-token values were recorded.

    Observed development handshake

    • The signed-out navigation ended at the HTTP 401 sign-in door without exposing the company patch.
    • After real Account Portal email-code sign-in, the local patch returned 307 to Frontend API /v1/client/handshake with format=nonce.
    • Frontend API returned 307 to the local patch with __clerk_handshake in the query, rather than a nonce return. Development therefore still returns the token form despite the nonce request.
    • Patchy accepted that return, applied the cookie directives, returned 307 to the clean patch URL, and served HTTP 200. A subsequent reload also returned 200.
    • On the app response, __session had Path=/; Secure; SameSite=None and no Domain attribute (host-only). __client_uat had Domain=127.0.0.1; Path=/; Secure; SameSite=None. The suffixed refresh cookie was host-only with HttpOnly; Secure; SameSite=None.

    Validation result

    All 3 browser tests passed in 1.6 minutes: the temporary handshake observation, the existing login-door workflow, and the existing packed-CLI login workflow. The existing workflows verified renewal after the token's actual expiry, private uncached responses, matching 404 responses for a foreign company's patch and a missing patch, device confirmation, the saved CLI identity, and loss of access after browser revocation.

    Run 97d8da29-363c-46cb-b709-e346cfd65abc completed at exit 0. Cleanup confirmed zero run-scoped Clerk users remain; the isolated server and database were torn down. The Backend-API/invitation-mail tier was not run.

    Remaining production limitation

    Neither accessible Clerk application has a production instance. There is no production Patchy HTTPS origin or Frontend API CNAME to exercise. The production return leg, actual production cookie Domain behavior, and whether production Frontend API honors format=nonce remain unverified. Revisit those observations when a production deployment exists; they do not block closing this auth map under the agreed scope.

    No door change was forced by the development observations. The temporary observer was removed; no repository changes remain. The wire contract, CLI contract/docs/skill, dev runner/seed, vocabulary, migrations, rendered-page implementation, reverse-state implementation, and repo layout were unchanged. Existing login/revocation behavior was exercised through the browser suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

wayfinder:task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions