-
Notifications
You must be signed in to change notification settings - Fork 392
chore(react-router): Accept organizationSyncOptions
option in middleware
#6927
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
Conversation
🦋 Changeset detectedLatest commit: 5025068 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe change adds an optional organizationSyncOptions property to ClerkMiddlewareOptions and forwards that option from loadOptions(...) into authenticateRequest(...) inside clerkMiddleware. No function signatures or return types changed; middleware control flow (handshake, headers, context, response) is unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Router
participant clerkMiddleware
participant ClerkBackend as Clerk Backend
Client->>Router: HTTP Request
Router->>clerkMiddleware: Invoke with request/context
note over clerkMiddleware: loadOptions(args, options)\nmay include organizationSyncOptions
clerkMiddleware->>ClerkBackend: authenticateRequest(request, { ..., organizationSyncOptions })
alt Authenticated
ClerkBackend-->>clerkMiddleware: RequestState (SignedIn/SignedOut)
clerkMiddleware-->>Router: Continue with context set
Router-->>Client: Response
else Handshake/Redirect
ClerkBackend-->>clerkMiddleware: Handshake/Redirect response
clerkMiddleware-->>Client: Proxy handshake/redirect response
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this to the react-router middleware! 🫡
Description
This PR adds the
organizationSyncOptions
option to React Router'sclerkMiddleware()
.Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit
New Features
Documentation