-
Notifications
You must be signed in to change notification settings - Fork 426
feat(clerk-js,ui,shared): Add Safari ITP decorateUrl workaround to setActive
#7623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ack for Safari ITP fix Why: Safari's Intelligent Tracking Prevention (ITP) caps cookies set via fetch/XHR to 7 days. When users switched from redirectUrl to the navigate callback pattern, the existing ITP workaround (via /v1/client/touch endpoint) stopped working because the touch endpoint logic only ran in the redirectUrl branch. What changed: - Added decorateUrl function to the navigate callback that wraps URLs with the touch endpoint when Safari ITP fix is needed (client.isEligibleForTouch()) - Updated SetActiveNavigate type signature to include decorateUrl parameter - Added dev-mode warning when decorateUrl is not called but ITP fix is needed - Updated all internal usages in SignIn, SignUp, and SessionTasks components to pass decorateUrl through navigateOnSetActive Context: The decorateUrl may return an external URL (https://...) when ITP fix is needed, requiring window.location.href instead of client-side navigation. This pattern is documented in the type definitions.
Why: The Safari ITP fix (decorateUrl in setActive) was added without integration test coverage. These tests ensure the touch endpoint navigation works correctly when the client cookie is close to expiration. What changed: - Added 4 tests covering the Safari ITP workaround flow - Tests verify touch endpoint is called when cookie expires within 8 days - Tests verify decorateUrl behavior with mocked isEligibleForTouch
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis pull request introduces Safari ITP (Intelligent Tracking Prevention) support by adding a Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@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/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: |
Description
Why:
Safari's Intelligent Tracking Prevention (ITP) caps cookies set via fetch/XHR
to 7 days. When users switched from redirectUrl to the navigate callback pattern,
the existing ITP workaround (via /v1/client/touch endpoint) stopped working
because the touch endpoint logic only ran in the redirectUrl branch.
What changed:
touch endpoint when Safari ITP fix is needed (client.isEligibleForTouch())
to pass decorateUrl through navigateOnSetActive
Context:
The decorateUrl may return an external URL (https://...) when ITP fix is needed,
requiring window.location.href instead of client-side navigation. This pattern
is documented in the type definitions.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Release Notes
New Features
decorateUrlparameter for URL wrapping when needed.Tests
✏️ Tip: You can customize this high-level summary in your review settings.