Skip to content

Commit 2a42934

Browse files
committed
update clerk/nextjs from 4.31.5 to 6.35.0 to support Next.js 16
1 parent 2b6efd8 commit 2a42934

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
legacy-peer-deps=true
2+

middleware.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { authMiddleware } from '@clerk/nextjs'
1+
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'
22

3-
export default authMiddleware({
4-
//* Make all routes public by default
5-
publicRoutes: ['/((?!community/contributors).*)'],
6-
//* Only protect the contributors page
7-
ignoredRoutes: ['/((?!community/contributors).*)']
3+
const isPublicRoute = createRouteMatcher(['/((?!community/contributors).*)'])
4+
5+
export default clerkMiddleware(async (auth, req) => {
6+
if (!isPublicRoute(req)) {
7+
await auth.protect()
8+
}
89
})
910

1011
export const config = {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"@ant-design/icons": "^6.0.0",
17-
"@clerk/nextjs": "^4.31.5",
17+
"@clerk/nextjs": "^6.35.0",
1818
"@clerk/themes": "^2.2.3",
1919
"@heroicons/react": "^2.0.18",
2020
"framer-motion": "^12.0.0",

0 commit comments

Comments
 (0)