import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
import { NextResponse } from "next/server";
const isProtectedRoute = createRouteMatcher(["/start(.*)"]);
export default clerkMiddleware(
(auth, request) => {
if (isProtectedRoute(request)) {
auth().protect();
}
return NextResponse.next();
},
{ debug: true },
);
export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next)._)", "/", "/(api|trpc)(._)"],
};
import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server";
import { NextResponse } from "next/server";
const isProtectedRoute = createRouteMatcher(["/start(.*)"]);
export default clerkMiddleware(
(auth, request) => {
if (isProtectedRoute(request)) {
auth().protect();
}
return NextResponse.next();
},
{ debug: true },
);
export const config = {
matcher: ["/((?!.+\\.[\\w]+$|_next)._)", "/", "/(api|trpc)(._)"],
};