@clerk/nextjs
Version:
Clerk SDK for NextJS
18 lines • 900 B
JavaScript
import "../chunk-BUSYA2B4.js";
import { deprecated } from "@clerk/shared/deprecated";
import { createPathMatcher } from "@clerk/shared/pathMatcher";
const createRouteMatcher = (routes) => {
deprecated(
"createRouteMatcher",
"Use resource-based auth checks instead. Move auth checks into each page, layout, API route, or Server Function that accesses protected data. Middleware-based auth checks rely on path matching, which can diverge from how Next.js routes requests and leave protected resources reachable. For a migration guide, see: https://clerk.com/docs/guides/development/upgrading/upgrade-guides/migrate-from-create-route-matcher"
);
if (typeof routes === "function") {
return (req) => routes(req);
}
const matcher = createPathMatcher(routes);
return (req) => matcher(req.nextUrl.pathname);
};
export {
createRouteMatcher
};
//# sourceMappingURL=routeMatcher.js.map