main
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { redirect } from 'next/navigation';
|
import { redirect } from 'next/navigation';
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function RootPage({ params }: { params: Promise<{ locale: string }> }) {
|
||||||
redirect('/home');
|
const { locale } = await params;
|
||||||
|
redirect(`/${locale}/home`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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|.*\\..*).*)']
|
|
||||||
};
|
|
||||||
@@ -36,8 +36,11 @@ export default function proxy(req: NextRequest) {
|
|||||||
return; // Return undefined to pass through without modification
|
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(
|
const publicPathnameRegex = RegExp(
|
||||||
`^(/(${routing.locales.join("|")}))?(${publicPages.flatMap((p) => (p === "/" ? ["", "/"] : p)).join("|")})/?$`,
|
`^(/(${routing.locales.join("|")}))?(${[...publicPages, ...additionalPublicPaths].flatMap((p) => (p === "/" ? ["", "/"] : p)).join("|")})/?$`,
|
||||||
"i",
|
"i",
|
||||||
);
|
);
|
||||||
const isPublicPage = publicPathnameRegex.test(req.nextUrl.pathname);
|
const isPublicPage = publicPathnameRegex.test(req.nextUrl.pathname);
|
||||||
|
|||||||
Reference in New Issue
Block a user