From 95a700aec96fece900768290a4b03ce228232d4e Mon Sep 17 00:00:00 2001 From: Harun CAN Date: Fri, 30 Jan 2026 04:59:11 +0300 Subject: [PATCH] main --- src/app/[locale]/page.tsx | 5 +++-- src/middleware.ts | 11 ----------- src/proxy.ts | 5 ++++- 3 files changed, 7 insertions(+), 14 deletions(-) delete mode 100644 src/middleware.ts diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 6cb3303..9be9701 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -1,5 +1,6 @@ import { redirect } from 'next/navigation'; -export default async function Page() { - redirect('/home'); +export default async function RootPage({ params }: { params: Promise<{ locale: string }> }) { + const { locale } = await params; + redirect(`/${locale}/home`); } diff --git a/src/middleware.ts b/src/middleware.ts deleted file mode 100644 index 3a4b4e5..0000000 --- a/src/middleware.ts +++ /dev/null @@ -1,11 +0,0 @@ -import createMiddleware from 'next-intl/middleware'; -import { routing } from './i18n/routing'; - -export default createMiddleware(routing); - -export const config = { - // Match all pathnames except for - // - … if they start with `/api`, `/_next` or `/_vercel` - // - … the ones containing a dot (e.g. `favicon.ico`) - matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'] -}; diff --git a/src/proxy.ts b/src/proxy.ts index 4e17c5a..7e82efe 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -36,8 +36,11 @@ export default function proxy(req: NextRequest) { return; // Return undefined to pass through without modification } + // Add explicit public paths that might not be in NAV_ITEMS (like pages) + const additionalPublicPaths = ['/games', '/games/.*']; + const publicPathnameRegex = RegExp( - `^(/(${routing.locales.join("|")}))?(${publicPages.flatMap((p) => (p === "/" ? ["", "/"] : p)).join("|")})/?$`, + `^(/(${routing.locales.join("|")}))?(${[...publicPages, ...additionalPublicPaths].flatMap((p) => (p === "/" ? ["", "/"] : p)).join("|")})/?$`, "i", ); const isPublicPage = publicPathnameRegex.test(req.nextUrl.pathname);