diff --git a/apps/nextjs-app/middleware.js b/apps/nextjs-app/middleware.js index b8028e3..59e74fc 100644 --- a/apps/nextjs-app/middleware.js +++ b/apps/nextjs-app/middleware.js @@ -12,26 +12,21 @@ const isPublicRoute = createRouteMatcher([ ]); const isPublicApi = createRouteMatcher([ - "/api(.*)", "/api/tutorial(.*)", "/api/search(.*)", - ]); export default clerkMiddleware((auth, req) => { if (isPublicRoute(req) || isPublicApi(req)) { - console.log("Public Route or API accessed:", req.url); - return; // Allow access without authentication + return; } - console.log("Private Route accessed:", req.url); - auth().protect(); // Require authentication + auth().protect(); }); export const config = { matcher: [ "/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)", - "/", "/(api|trpc)(.*)", ], };