fix(clerk-js): Use first-party cookies when running on Cypress - #3245
Conversation
🦋 Changeset detectedLatest commit: fc3a263 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
!snapshot |
|
Hey @anagstef - 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/chrome-extension@1.0.1-snapshot.v3a06a37 --save-exact
npm i @clerk/clerk-js@5.1.0-snapshot.v3a06a37 --save-exact
npm i @clerk/clerk-expo@1.0.1-snapshot.v3a06a37 --save-exact
npm i @clerk/fastify@1.0.1-snapshot.v3a06a37 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/localizations@2.1.0-snapshot.v3a06a37 --save-exact
npm i @clerk/nextjs@5.0.2-snapshot.v3a06a37 --save-exact
npm i @clerk/clerk-react@5.0.1-snapshot.v3a06a37 --save-exact
npm i @clerk/remix@4.0.1-snapshot.v3a06a37 --save-exact
npm i @clerk/themes@2.0.1-snapshot.v3a06a37 --save-exact
npm i @clerk/types@4.1.0-snapshot.v3a06a37 --save-exact |
3a06a37 to
bd3f75e
Compare
|
!snapshot |
|
Hey @anagstef - 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/backend@1.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/chrome-extension@1.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/clerk-js@5.1.0-snapshot.vbd3f75e --save-exact
npm i @clerk/clerk-expo@1.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/express@0.0.2-snapshot.vbd3f75e --save-exact
npm i @clerk/fastify@1.0.1-snapshot.vbd3f75e --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/localizations@2.1.0-snapshot.vbd3f75e --save-exact
npm i @clerk/nextjs@5.0.2-snapshot.vbd3f75e --save-exact
npm i @clerk/clerk-react@5.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/remix@4.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/clerk-sdk-node@5.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/testing@1.0.0-snapshot.vbd3f75e --save-exact
npm i @clerk/themes@2.0.1-snapshot.vbd3f75e --save-exact
npm i @clerk/types@4.1.0-snapshot.vbd3f75e --save-exact |
|
!snapshot |
|
Hey @anagstef - 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/chrome-extension@1.0.7-snapshot.v47a3ff9 --save-exact
npm i @clerk/clerk-js@5.2.3-snapshot.v47a3ff9 --save-exact
npm i @clerk/clerk-expo@1.0.7-snapshot.v47a3ff9 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact |
* fix(clerk-js): Use first-party cookies when running on Cypress * fix(clerk-js): Create isCypress util (cherry picked from commit 7b213d5)
…lure logging (#3384) * fix(clerk-js): Improve logging for CAPTCHA script loading errors (#3374) * fix(clerk-js): Improve logging for CAPTCHA script loading errors * fix(clerk-js): Remove the generic CAPTCHA console error (cherry picked from commit 34befee) * fix(clerk-js): Use first-party cookies when running on Cypress (#3245) * fix(clerk-js): Use first-party cookies when running on Cypress * fix(clerk-js): Create isCypress util (cherry picked from commit 7b213d5)
Description
The issue:
Cypress discards third-party cookies. Also, it runs in an iframe.
If we detect that clerk-js runs inside an iframe, we set our cookies with
SameSite: None(third-party).So, the following cookies never get set in the browser:
__session__client_uat__clerk_db_jwtProposed solution:
Cypress adds a global object on the window, on the
window.Cypressproperty. We can exclude cookies getting set as third-party if we detect that the app runs inside Cypress.Checklist
npm testruns as expected.npm run buildruns as expected.Type of change