Deprecate createRouteMatcher in Nuxt docs in favor of built-in route protection - #3406
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
79c7ea8 to
d6714d3
Compare
f02d2a7 to
5fad417
Compare
d6714d3 to
816e20d
Compare
5fad417 to
5701fe8
Compare
816e20d to
eb40e02
Compare
…protection Rewrites the Nuxt protect-pages guide to use Nuxt's named route middleware (definePageMeta inheritance) and route groups (route.meta.groups, Nuxt 4.3+) instead of createRouteMatcher, updates the overview accordingly, and switches the clerkMiddleware API-route examples to event.path prefix checks (also destructuring has() correctly).
Clarify that the reference covers server (API) routes, which have no
file-system page tree to inherit from, so matching event.path is the right
tool here, and point page protection at Nuxt's built-in route middleware. This
resolves the apparent contradiction with protect-pages.nuxt.mdx ('no separate
list'). Soften the createRouteMatcher NOTE to 'no longer recommended' to match
the shared partial.
eb40e02 to
1150e41
Compare
|
Heads up: this PR is part of the #3426 carries a reframed, positive-recommendation version of the shared Keeping |
|
Superseded by #3426. The Nuxt deprecation ( |
Stacked on #3405. Moves the Nuxt docs off
createRouteMatcherto Nuxt's built-in route protection.protect-pages.nuxtnow uses named route middleware (definePageMetawith file-system inheritance) and route groups (route.meta.groups, Nuxt 4.3+) instead of matching paths by hand, and the API-route examples in the middleware reference useevent.pathprefix checks. While rewriting the authorization example I also destructuredhas()fromevent.context.auth(), which was previously referenced but never defined.