-
Notifications
You must be signed in to change notification settings - Fork 403
chore(repo): Retry handshake in case of handshake cookie collision #3848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 8a4aeec The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
59186ef to
acc9802
Compare
acc9802 to
6b79914
Compare
682c57c to
b6b22c0
Compare
If a handshake loop occurs, it's going to be stopped by the infinite loop prevention mechanism and the request will terminate with a signed out state
b6b22c0 to
8a4aeec
Compare
…3848) Co-authored-by: Dimitris Klouvas <dimitris@clerk.dev>
|
!snapshot multiapp |
|
Hey @nikosdouvlis - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.0.5-multiapp.v8a4aeec --save-exact
npm i @clerk/backend@1.5.0-multiapp.v8a4aeec --save-exact
npm i @clerk/chrome-extension@1.1.8-multiapp.v8a4aeec --save-exact
npm i @clerk/clerk-js@5.10.3-multiapp.v8a4aeec --save-exact
npm i @clerk/elements@0.11.0-multiapp.v8a4aeec --save-exact
npm i @clerk/clerk-expo@2.0.1-multiapp.v8a4aeec --save-exact
npm i @clerk/express@0.0.22-multiapp.v8a4aeec --save-exact
npm i @clerk/fastify@1.0.24-multiapp.v8a4aeec --save-exact
npm i @clerk/localizations@2.5.3-multiapp.v8a4aeec --save-exact
npm i @clerk/nextjs@5.2.9-multiapp.v8a4aeec --save-exact
npm i @clerk/remix@4.2.8-multiapp.v8a4aeec --save-exact
npm i @clerk/clerk-sdk-node@5.0.21-multiapp.v8a4aeec --save-exact
npm i @clerk/tanstack-start@0.1.12-multiapp.v8a4aeec --save-exact
npm i @clerk/testing@1.2.4-multiapp.v8a4aeec --save-exact |
Description
We want the
__clerk_handshakecookie to always be set on the ETLD+1 domain in order to support multiple apps running on the same domain, even if the apps are running on different same-level subdomains, for example,sub1.a.example.comandsub2.a.example.comOf course, with multiple apps running, we risk collisions if more than one app needs to handshake at the same time (e.g., reopen a browser window with multiple tabs open).
We can deal with collisions in 3 different ways:
This PR implements solution 3. We let the handshake cookies collide. In the extremely rare case of a collision, the app that accidentally reads a handshake cookie of a different instance will simply ignore it (signature verification will fail) and retry the handshake again if needed.
This PR also adds an infinite redirect loop protection mechanism to protect against the case where a customer accidentally added a PK/SK pair that does not match.
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change