diff --git a/middleware.ts b/middleware.ts index 4921dd2c..c62bf59e 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1,11 +1,14 @@ import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server"; -const isProtectedRoute = createRouteMatcher(["/dashboard(.*)"]); +const isProtectedRoute = createRouteMatcher([ + "/dashboard(.*)", + "/api/generate-tests(.*)", +]); export default clerkMiddleware((auth, req) => { if (isProtectedRoute(req)) auth().protect(); }); export const config = { - matcher: ["/((?!.*\\..*|_next).*)", "/"], + matcher: ["/((?!.*\\..*|_next).*)", "/", "/api/generate-tests(.*)"], };