Skip to content

Commit 1a9dd14

Browse files
committed
Merge remote-tracking branch 'origin/main' into v4
2 parents 7decc4c + 676debe commit 1a9dd14

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/src/pages/docs/routing.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export const routing = defineRouting({
423423

424424
### Turning off locale detection [#locale-detection]
425425

426-
The middleware will [detect a matching locale](/docs/routing/middleware#locale-detection) based on your routing configuration and the incoming request.
426+
The middleware will [detect a matching locale](/docs/routing/middleware#locale-detection) based on your routing configuration & the incoming request and will either pass the request through for a matching locale or redirect to one that matches.
427427

428428
If you want to rely entirely on the URL to resolve the locale, you can set the `localeDetection` property to `false`. This will disable locale detection based on the `accept-language` header and a potentially existing cookie value from a previous visit.
429429

docs/src/pages/docs/routing/middleware.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ const handleI18nRouting = createMiddleware(routing);
216216

217217
const isProtectedRoute = createRouteMatcher(['/:locale/dashboard(.*)']);
218218

219-
export default clerkMiddleware((auth, req) => {
220-
if (isProtectedRoute(req)) auth().protect();
219+
export default clerkMiddleware(async (auth, req) => {
220+
if (isProtectedRoute(req)) await auth.protect();
221221

222222
return handleI18nRouting(req);
223223
});
@@ -228,7 +228,7 @@ export const config = {
228228
};
229229
```
230230

231-
(based on `@clerk/nextjs@^5.0.0`)
231+
(based on `@clerk/nextjs@^6.0.0`)
232232

233233
### Example: Integrating with Supabase Authentication
234234

0 commit comments

Comments
 (0)