Update major dependencies (#408)

This commit is contained in:
Luke Vella 2023-01-20 10:43:48 +00:00 committed by GitHub
parent 6332d6459f
commit e845d36c51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 1294 additions and 775 deletions

View file

@ -28,9 +28,8 @@ export function middleware({ headers, cookies, nextUrl }: NextRequest) {
// Check if locale is specified in cookie
const localeCookie = cookies.get("NEXT_LOCALE");
if (localeCookie && supportedLocales.includes(localeCookie)) {
newUrl.pathname = `/${localeCookie}${newUrl.pathname}`;
if (localeCookie && supportedLocales.includes(localeCookie.value)) {
newUrl.pathname = `/${localeCookie.value}${newUrl.pathname}`;
return NextResponse.rewrite(newUrl);
} else {
// Check if locale is specified in header
@ -53,5 +52,13 @@ export function middleware({ headers, cookies, nextUrl }: NextRequest) {
}
export const config = {
matcher: ["/admin/:id", "/demo", "/p/:id", "/profile", "/new", "/login"],
matcher: [
"/admin/:id",
"/demo",
"/p/:id",
"/profile",
"/new",
"/login",
"/polls",
],
};