fix(clerk-js): Set SameSite=None on cookies for .replit.dev origins#7846
fix(clerk-js): Set SameSite=None on cookies for .replit.dev origins#7846
Conversation
Cookies on .replit.dev origins need SameSite=None to work correctly. Adds a shared requiresSameSiteNone() helper used by session, clientUat, and devBrowser cookie setters. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 80dad18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 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 |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughAdds a shared third-party domains list and a new re-export 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. No actionable comments were generated in the recent review. 🎉 Comment |
Extract POPUP_PREFERRED_ORIGINS and requiresSameSiteNone into a shared THIRD_PARTY_COOKIE_DOMAINS list in @clerk/shared. Both originPrefersPopup and cookie SameSite logic now reference the same list, which includes .replit.dev. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/ui/src/utils/originPrefersPopup.ts`:
- Line 10: The bug is that originPrefersPopup() uses window.location.origin
(which includes protocol and port) causing domain matching to fail; change the
check to use window.location.hostname instead so
THIRD_PARTY_COOKIE_DOMAINS.some(domain =>
window.location.hostname.endsWith(domain)) (preserving the existing inIframe()
short-circuit) within the originPrefersPopup function to mirror
isThirdPartyCookieDomain() behavior.
106KB → 107KB to accommodate the new thirdPartyDomains import. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…PrefersPopup window.location.origin includes protocol and port, causing domain suffix matching to fail. Switch to window.location.hostname to mirror isThirdPartyCookieDomain() behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
requiresSameSiteNone()helper that detects.replit.devoriginsSameSite=Noneon these originsTest plan
SameSite=Noneis set whenrequiresSameSiteNone()returns true.replit.devorigin🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
New Features
Tests