From 9782bd8005941d6e8451b27dfb4d213f65bbdb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Peyronnet?= Date: Sat, 7 Oct 2023 19:16:00 +0200 Subject: [PATCH] Delete middleware.ts --- middleware.ts | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 middleware.ts diff --git a/middleware.ts b/middleware.ts deleted file mode 100644 index 9d72ca93..00000000 --- a/middleware.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { NextResponse } from "next/server"; - -export function middleware(request: any) { - const localeCookie = request.cookies.get("NEXT_LOCALE")?.value; - if (localeCookie !== undefined && request.nextUrl.locale !== localeCookie) { - console.log( - new URL(`/${localeCookie.value}/${request.nextUrl.pathname}`, request.url) - .href - ); - return NextResponse.redirect( - new URL( - `/${localeCookie}${request.nextUrl.pathname}`, - request.url - ).href.toString() - ); - } -} -export const config = { - matcher: ["/", "/home"], // paths on which middleware will work -};