sumisura
TTCTheo's Typesafe Cult
•Created by DYELbrah on 4/14/2024 in #questions
How to exclude specific routes from Clerk middleware?
Since you are using the older, deprecated authMiddleware, you have two options:
1. Use
ignoredRoutes
to explicitly exclude that route.
2. Change the regex for matcher
to not match /api/cron
You can find more info here: https://clerk.com/docs/references/nextjs/auth-middleware
I suggest you ignore /api/cron
. Just know that this path will not be protected by Clerk. You'll have to handle authentication yourself.
3 replies