mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-20 17:57:22 +02:00
Update major dependencies (#408)
This commit is contained in:
parent
6332d6459f
commit
e845d36c51
30 changed files with 1294 additions and 775 deletions
|
@ -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",
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue