Skip to content

Commit fe61d98

Browse files
jacekradkoCopilot
andauthored
fix(clerk-js): Force SameSite=none for chips (#5775)
Co-authored-by: Copilot <[email protected]>
1 parent 294da82 commit fe61d98

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/hungry-foxes-sell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Forcing \_\_session cookie to have SameSite=none attribute in the CHIPS build variant

packages/clerk-js/src/core/auth/cookies/session.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const createSessionCookie = (cookieSuffix: string): SessionCookieHandler
2929

3030
const set = (token: string) => {
3131
const expires = addYears(Date.now(), 1);
32-
const sameSite = inCrossOriginIframe() ? 'None' : 'Lax';
32+
const sameSite = __BUILD_VARIANT_CHIPS__ ? 'None' : inCrossOriginIframe() ? 'None' : 'Lax';
3333
const secure = getSecureAttribute(sameSite);
34-
const partitioned = __BUILD_VARIANT_CHIPS__ && secure && sameSite === 'None';
34+
const partitioned = __BUILD_VARIANT_CHIPS__ && secure;
3535

3636
// If setting Partitioned to true, remove the existing session cookies.
3737
// This is to avoid conflicts with the same cookie name without Partitioned attribute.

0 commit comments

Comments
 (0)