From 18157bc255c0f278e85569c9e367f40d5806b0c1 Mon Sep 17 00:00:00 2001 From: Jan Amann Date: Tue, 28 Nov 2023 13:14:03 +0100 Subject: [PATCH] docs: `localePrefix: 'never'` is useful for domain-based routing too --- docs/pages/docs/routing/middleware.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/docs/routing/middleware.mdx b/docs/pages/docs/routing/middleware.mdx index 1eb3988de..f85ce8b5d 100644 --- a/docs/pages/docs/routing/middleware.mdx +++ b/docs/pages/docs/routing/middleware.mdx @@ -182,7 +182,7 @@ In this case, requests where the locale prefix matches the default locale will b #### Never use a locale prefix [#locale-prefix-never] -For applications behind an authentication layer, where there is no need for SEO, it is possible to have the locale never show up in the URL. +If you're building an app behind an authentication layer, where there is no need for SEO, or you're using [domain-based routing](#domain-based-routing) and you have distinct domains per locale, you can configure the middleware to never show a locale prefix in the URL. ```tsx filename="middleware.ts" {6} import createMiddleware from 'next-intl/middleware'; @@ -448,8 +448,8 @@ export default async function middleware(req: NextRequest) { }); const res = handleI18nRouting(req); - const supabase = createMiddlewareClient({ req, res }) - await supabase.auth.getSession() + const supabase = createMiddlewareClient({req, res}); + await supabase.auth.getSession(); return res; }