Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-rats-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Fix Cypress setting cookies as third-party
8 changes: 7 additions & 1 deletion packages/clerk-js/src/utils/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ export function usesHttps() {
return inBrowser() && window.location.protocol === 'https:';
}

function isCypress() {
return typeof window !== 'undefined' && typeof (window as any).Cypress !== 'undefined';
}

export function inIframe() {
return inBrowser() && window.self !== window.top;
// checks if the current window is an iframe
// excludes the case where the current window runs in a Cypress test
return inBrowser() && window.self !== window.top && !isCypress();
}

export function inCrossOriginIframe() {
Expand Down