René's URL Explorer Experiment


Title: fix(fastify): Add __internal_enableHandshake option to skip handshake flow by jescalan · Pull Request #8560 · clerk/javascript · GitHub

Open Graph Title: fix(fastify): Add __internal_enableHandshake option to skip handshake flow by jescalan · Pull Request #8560 · clerk/javascript

X Title: fix(fastify): Add __internal_enableHandshake option to skip handshake flow by jescalan · Pull Request #8560 · clerk/javascript

Description: Summary add an internal __internal_enableHandshake option to clerkPlugin() (defaults to true) when set to false, strip handshake cookies (__clerk_handshake, __clerk_handshake_nonce) and query params before calling authenticateRequest, and skip handshake redirects keep dev-browser handshake redirects (dev-browser-missing, dev-browser-sync) even when disabled, since development instances cannot establish auth state without them fall back to a signed-out auth object when a handshake redirect is skipped (a handshake state's toAuth() is null), and drop the already-applied Location/Cache-Control headers from the reply add focused regression coverage for the disabled flow, the dev-browser exception, and the default behavior Context Forced handshake nonce transport stores a short __clerk_handshake_nonce instead of the large __clerk_handshake payload. Server SDKs then need to exchange that nonce through the Backend API client attached to authenticateRequest. On an API-only backend that cannot deliver Set-Cookie headers back to the browser (e.g. Fastify on Lambda behind API Gateway, where multi-value Set-Cookie headers are dropped), the browser can never clear that nonce cookie. Every subsequent request replays the already-consumed nonce, and the exchange returns 404 resource_not_found, logging Clerk: HandshakeService: error getting handshake payload on each request. authenticateRequest already tolerates the failed exchange and falls through to cookie verification, so disabling the handshake removes the per-request error noise, the wasted Backend API call, and handshake redirects that an API client can never complete. The option is __internal_-prefixed rather than public because @clerk/express deprecated (#6499) and removed (#7926) its public enableHandshake option, and we don't want to reintroduce public API surface for this. The affected customer has been running the equivalent behavior in production via snapshot since May 22 with the errors fully gone. Notes The runtime-keys client construction changes originally on this branch shipped separately in #8640, so the branch was rebuilt on main and now contains only the handshake option. The dev-browser reasons are compared as string literals because AuthErrorReason is not exported from @clerk/backend/internal; exporting it is a one-line @clerk/backend change if preferred. ✎

Open Graph Description: Summary add an internal __internal_enableHandshake option to clerkPlugin() (defaults to true) when set to false, strip handshake cookies (__clerk_handshake, __clerk_handshake_nonce) and query para...

X Description: Summary add an internal __internal_enableHandshake option to clerkPlugin() (defaults to true) when set to false, strip handshake cookies (__clerk_handshake, __clerk_handshake_nonce) and query para...

Opengraph URL: https://github.com/clerk/javascript/pull/8560

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f590f77f-0a7a-ae9e-fb39-4e33d1e518a1
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id90FA:2360CE:2C9D01:3FCFEE:6AFAC41B
html-safe-noncebf7abe03ab60cc2bec4528502aad24459b0ff1c399b213f2f16630f23948a8cf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEZBOjIzNjBDRToyQzlEMDE6M0ZDRkVFOjZBRkFDNDFCIiwidmlzaXRvcl9pZCI6IjE4NDQ1ODExOTcyMDg1MzYwOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca3c284e99d0525c6beadf4506e391aba58a0e3fbae48e9e2a40e185cae35d6fd
hovercard-subject-tagpull_request:3690571735
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/clerk/javascript/pull/8560/files
twitter:imagehttps://avatars.githubusercontent.com/u/556932?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/556932?s=400&v=4
og:image:altSummary add an internal __internal_enableHandshake option to clerkPlugin() (defaults to true) when set to false, strip handshake cookies (__clerk_handshake, __clerk_handshake_nonce) and query para...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/clerk/javascript git https://github.com/clerk/javascript.git
octolytics-dimension-user_id49538330
octolytics-dimension-user_loginclerk
octolytics-dimension-repository_id438331492
octolytics-dimension-repository_nwoclerk/javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id438331492
octolytics-dimension-repository_network_root_nwoclerk/javascript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release072e34035c13c31543fba9f025cbbbda4210dae4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/clerk/javascript/pull/8560/changes#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclerk%2Fjavascript%2Fpull%2F8560%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fclerk%2Fjavascript%2Fpull%2F8560%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=clerk%2Fjavascript
Reloadhttps://github.com/clerk/javascript/pull/8560/changes
Reloadhttps://github.com/clerk/javascript/pull/8560/changes
Reloadhttps://github.com/clerk/javascript/pull/8560/changes
clerkhttps://github.com/clerk
javascripthttps://github.com/clerk/javascript
Codehttps://github.com/clerk/javascript
Issues44 (44)https://github.com/clerk/javascript/issues
Pull requests112 (112)https://github.com/clerk/javascript/pulls
Discussionshttps://github.com/clerk/javascript/discussions
Actionshttps://github.com/clerk/javascript/actions
Security and quality6 (6)https://github.com/clerk/javascript/security
Insightshttps://github.com/clerk/javascript/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fclerk%2Fjavascript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fclerk%2Fjavascript%2Fissues%2Fnew%2Fchoose
wobsorianohttps://github.com/wobsoriano
mainhttps://github.com/clerk/javascript/tree/main
fix/fastify-runtime-secret-handshakehttps://github.com/clerk/javascript/tree/fix/fastify-runtime-secret-handshake
Conversation 27 https://github.com/clerk/javascript/pull/8560
Commits 3 https://github.com/clerk/javascript/pull/8560/commits
Checks 47 https://github.com/clerk/javascript/pull/8560/checks
Files changed https://github.com/clerk/javascript/pull/8560/files
Please reload this pagehttps://github.com/clerk/javascript/pull/8560/changes
fix(fastify): Add __internal_enableHandshake option to skip handshake flow https://github.com/clerk/javascript/pull/8560/changes#top
Show all changes 3 commits https://github.com/clerk/javascript/pull/8560/files
815b7c0 fix(fastify): Add __internal_enableHandshake option to skip handshake… wobsoriano Sep 1, 2026 https://github.com/clerk/javascript/pull/8560/commits/815b7c0b9561574b3ded73e219b28b601592b87d
386bcff refactor(fastify): Move stripHandshakeCookiesAndParams to utils wobsoriano Sep 1, 2026 https://github.com/clerk/javascript/pull/8560/commits/386bcffcd425405f470b0479a7a947307e15a7e5
3823adc Merge branch 'main' into fix/fastify-runtime-secret-handshake wobsoriano Sep 1, 2026 https://github.com/clerk/javascript/pull/8560/commits/3823adc0e00176f6b80f0fccb4fbad61326efcd9
Clear filters https://github.com/clerk/javascript/pull/8560/files
Please reload this pagehttps://github.com/clerk/javascript/pull/8560/changes
Please reload this pagehttps://github.com/clerk/javascript/pull/8560/changes
fastify-internal-enable-handshake.md https://github.com/clerk/javascript/pull/8560/changes#diff-a8e5362b215f8f9c2afd9d6f018ce2676fbf2691e9fcf5525e6e6d833f202b3b
withClerkMiddleware.test.ts https://github.com/clerk/javascript/pull/8560/changes#diff-f59e56b001eda22814ef1f116ce8b55a760474629d438d24291bc5974e717961
types.ts https://github.com/clerk/javascript/pull/8560/changes#diff-bdce2b7284970f09198031db19213a695a97f22d2795a9859172bde5d7e82f81
utils.ts https://github.com/clerk/javascript/pull/8560/changes#diff-54e70e793a80dfff608228a2915d9d1f6517e8eb05aaa8062951e8e9291cb9ac
withClerkMiddleware.ts https://github.com/clerk/javascript/pull/8560/changes#diff-e9357ff8f24a12a7c3f60e8fe95a0553dc35a5e7348ce2b8731ce0557474e3e5
.changeset/fastify-internal-enable-handshake.mdhttps://github.com/clerk/javascript/pull/8560/changes#diff-a8e5362b215f8f9c2afd9d6f018ce2676fbf2691e9fcf5525e6e6d833f202b3b
View file https://github.com/clerk/javascript/blob/3823adc0e00176f6b80f0fccb4fbad61326efcd9/.changeset/fastify-internal-enable-handshake.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/clerk/javascript/pull/8560/{{ revealButtonHref }}
packages/fastify/src/__tests__/withClerkMiddleware.test.tshttps://github.com/clerk/javascript/pull/8560/changes#diff-f59e56b001eda22814ef1f116ce8b55a760474629d438d24291bc5974e717961
View file https://github.com/clerk/javascript/blob/3823adc0e00176f6b80f0fccb4fbad61326efcd9/packages/fastify/src/__tests__/withClerkMiddleware.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/clerk/javascript/pull/8560/{{ revealButtonHref }}
https://github.com/clerk/javascript/pull/8560/changes#diff-f59e56b001eda22814ef1f116ce8b55a760474629d438d24291bc5974e717961
packages/fastify/src/types.tshttps://github.com/clerk/javascript/pull/8560/changes#diff-bdce2b7284970f09198031db19213a695a97f22d2795a9859172bde5d7e82f81
View file https://github.com/clerk/javascript/blob/3823adc0e00176f6b80f0fccb4fbad61326efcd9/packages/fastify/src/types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/clerk/javascript/pull/8560/{{ revealButtonHref }}
https://github.com/clerk/javascript/pull/8560/changes#diff-bdce2b7284970f09198031db19213a695a97f22d2795a9859172bde5d7e82f81
packages/fastify/src/utils.tshttps://github.com/clerk/javascript/pull/8560/changes#diff-54e70e793a80dfff608228a2915d9d1f6517e8eb05aaa8062951e8e9291cb9ac
View file https://github.com/clerk/javascript/blob/3823adc0e00176f6b80f0fccb4fbad61326efcd9/packages/fastify/src/utils.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/clerk/javascript/pull/8560/{{ revealButtonHref }}
https://github.com/clerk/javascript/pull/8560/changes#diff-54e70e793a80dfff608228a2915d9d1f6517e8eb05aaa8062951e8e9291cb9ac
packages/fastify/src/withClerkMiddleware.tshttps://github.com/clerk/javascript/pull/8560/changes#diff-e9357ff8f24a12a7c3f60e8fe95a0553dc35a5e7348ce2b8731ce0557474e3e5
View file https://github.com/clerk/javascript/blob/3823adc0e00176f6b80f0fccb4fbad61326efcd9/packages/fastify/src/withClerkMiddleware.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/clerk/javascript/pull/8560/{{ revealButtonHref }}
https://github.com/clerk/javascript/pull/8560/changes#diff-e9357ff8f24a12a7c3f60e8fe95a0553dc35a5e7348ce2b8731ce0557474e3e5
https://github.com/clerk/javascript/pull/8560/changes#diff-e9357ff8f24a12a7c3f60e8fe95a0553dc35a5e7348ce2b8731ce0557474e3e5
https://github.com/clerk/javascript/pull/8560/changes#diff-e9357ff8f24a12a7c3f60e8fe95a0553dc35a5e7348ce2b8731ce0557474e3e5
Please reload this pagehttps://github.com/clerk/javascript/pull/8560/changes
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.