Skip to content

Commit 6f1ee33

Browse files
author
Jacek
committed
chore(nuxt): Trim changeset
1 parent 12decde commit 6f1ee33

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

‎.changeset/nuxt-deprecate-route-matcher.md‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Deprecate `createRouteMatcher()` in favor of Nuxt's native route matching.
77
To protect API routes, match paths natively inside `clerkMiddleware()`:
88

99
```ts
10-
import { clerkMiddleware } from '@clerk/nuxt/server';
11-
1210
export default clerkMiddleware(event => {
1311
const { isAuthenticated } = event.context.auth();
1412
const { pathname } = getRequestURL(event);
@@ -19,15 +17,4 @@ export default clerkMiddleware(event => {
1917
});
2018
```
2119

22-
To protect pages, use Nuxt's built-in route middleware: create a named middleware that checks the user's authentication status and opt pages into it with `definePageMeta({ middleware: 'auth' })`. Child routes inherit the middleware applied to their parent, so a single declaration can protect a whole section.
23-
24-
```ts
25-
// app/middleware/auth.ts
26-
export default defineNuxtRouteMiddleware(() => {
27-
const { isSignedIn } = useAuth();
28-
29-
if (!isSignedIn.value) {
30-
return navigateTo('/sign-in');
31-
}
32-
});
33-
```
20+
To protect pages, use Nuxt's built-in route middleware with `definePageMeta({ middleware: 'auth' })`.

0 commit comments

Comments
 (0)