TTC
Theo's Typesafe CultDYELbrah
How to exclude specific routes from Clerk middleware?
Anyone know how I can exclude the middleware from Clerk from running on my routes in folder: /api/cron?
Here's the current file:
I believe we need to update the matcher but not sure how to do it correctly.
S
sumisura•7d ago
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.
Next.js: authMiddleware()
The
authMiddleware()
method allows you to protect your Next.js application using middleware.21KMembers
View on DiscordWant results from more Discord servers?
More PostsFor Sr+ Engineers: Frontend, Backend, or Full-stack?For the engineers that have been around a while, been successful in what they started with, and starIt works locally but doesn't save to the database when deployed on Vercel.It's working fine on my local machine, but after deploying to Vercel, it's not saving data to the daError on NextJs AppRouterAnyone knows why this is showing on my console?useFormState in tables, or complex formsI decided to play with the new server components and useFormState. I am building myself the table shHow are signals going to be any different that state variables in React?I was just watching Theo's videos on signals coming to javascript (https://www.youtube.com/watch?v=JNext redirect() gives date.getTime() errorI use lucia auth with nextjs. And all things are okay until i add `redirect('/blog/login')` fuction