chore(repo): Retry handshake in case of handshake cookie collision#3848
Merged
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 |
dimkl
reviewed
Jul 31, 2024
dimkl
reviewed
Jul 31, 2024
dimkl
reviewed
Jul 31, 2024
59186ef to
acc9802
Compare
acc9802 to
6b79914
Compare
brkalow
reviewed
Aug 1, 2024
brkalow
reviewed
Aug 1, 2024
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
wobsoriano
pushed a commit
that referenced
this pull request
Aug 1, 2024
…3848) Co-authored-by: Dimitris Klouvas <dimitris@clerk.dev>
Member
Author
|
!snapshot multiapp |
Collaborator
|
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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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