Files
stats/apps/dashboard/src/middleware.ts
Carl-Gerhard Lindesvärd 763d25385d option to debug clerk
2024-04-17 09:35:11 +02:00

25 lines
647 B
TypeScript

import { authMiddleware } from '@clerk/nextjs';
// This example protects all routes including api/trpc routes
// Please edit this to allow other routes to be public as needed.
// See https://clerk.com/docs/references/nextjs/auth-middleware for more information about configuring your Middleware
export default authMiddleware({
publicRoutes: [
'/share/overview/:id',
'/api/trpc(.*)',
'/api/clerk/(.*)?',
'/monitoring',
],
debug: process.env.CLERK_DEBUG ? true : false,
});
export const config = {
matcher: [
'/((?!.+\\.[\\w]+$|_next).*)',
'/',
'/(api)(.*)',
'/(api|trpc)(.*)',
'/api/trpc(.*)',
],
};