refactor: migrate deprecated middleware convention to proxy (Next 16)

Middlewate file convention is deprecated in Next 16.3.5 (renamed to proxy).
git mv middleware.ts -> proxy.ts, rename exported fn middleware -> proxy.
Build now emits `ƒ Proxy (Middleware)` with no deprecation warning.
This commit is contained in:
asepharyana
2026-09-20 21:27:28 +07:00
committed by gwm-bot
parent 29b9a6618c
commit dcc6fc2c0a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -48,4 +48,4 @@ updates:
patterns: ["*"] patterns: ["*"]
update-types: update-types:
- "minor" - "minor"
- "patch" - "patch"
+1 -1
View File
@@ -3,7 +3,7 @@ import { getSessionCookie } from "better-auth/cookies";
const PROTECTED_PATHS = ["/protected"]; const PROTECTED_PATHS = ["/protected"];
export function middleware(request: NextRequest) { export function proxy(request: NextRequest) {
const { pathname } = request.nextUrl; const { pathname } = request.nextUrl;
if (PROTECTED_PATHS.some((p) => pathname.startsWith(p))) { if (PROTECTED_PATHS.some((p) => pathname.startsWith(p))) {