fix(express): forward clockSkewInMs in clerkMiddleware#8287
Conversation
🦋 Changeset detectedLatest commit: a5e8270 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. 1 Skipped Deployment
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request forwards the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/express/src/__tests__/clerkMiddleware.test.ts`:
- Around line 120-122: The test uses a type-only import Request at runtime in
expect.any(Request) which fails TypeScript compilation; update the assertion
comparing the first argument to use a runtime-safe matcher (e.g.,
expect.anything() or expect.any(Object)) instead of expect.any(Request) so
authenticateRequestMock is asserted without referencing the type-only Request
symbol at runtime.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 3ddeef75-5ef6-4332-b8a8-aa5c9df1b844
📒 Files selected for processing (3)
.changeset/red-pans-sing.mdpackages/express/src/__tests__/clerkMiddleware.test.tspackages/express/src/authenticateRequest.ts
@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: |
Description
This fixes an
@clerk/expressbug whereclockSkewInMswas accepted by the middleware options type but not forwarded to backendauthenticateRequest().The change explicitly passes
clockSkewInMsthrough in the Express wrapper and adds a regression test to verify the option is forwarded.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Verification
pnpm turbo run test --filter=@clerk/expresspnpm turbo run build --filter=@clerk/express