mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-18 04:43:58 +00:00
18 lines
470 B
TypeScript
18 lines
470 B
TypeScript
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';
|
|
|
|
const isProtectedRoute = createRouteMatcher([
|
|
'/dashboard(.*)',
|
|
'/onboarding(.*)',
|
|
'/api(.*)',
|
|
]);
|
|
|
|
export default clerkMiddleware(async (auth, req) => {
|
|
if (isProtectedRoute(req)) {
|
|
await auth.protect();
|
|
}
|
|
});
|
|
|
|
// Also exclude tunnelRoute used in Sentry from the matcher.
|
|
export const config = {
|
|
matcher: ['/((?!.+\\.[\\w]+$|_next|monitoring).*)', '/', '/(api|trpc)(.*)'],
|
|
};
|