chore(express): Deprecate requireAuth() helper#8241
Conversation
Add runtime deprecation warning and @deprecated JSDoc tag to requireAuth(). Users should migrate to clerkMiddleware() with getAuth() instead.
🦋 Changeset detectedLatest commit: b705127 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.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughA new Changesets entry declares a minor release for 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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/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
The
requireAuth()middleware is confusing. Developers use it expecting a 401 response for unauthenticated API requests, but it actually redirects to a configured sign-in page, producing a different response code. This mismatch leads to unexpected behavior, especially for API routes.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Deprecations
requireAuth()middleware is now deprecated and will be removed in the next major version. Migrate toclerkMiddleware()combined withgetAuth()for handling unauthenticated requests explicitly.Documentation