fix: rename middleware.ts to proxy.ts for Next.js 16 compatibility
Some checks failed
Deploy to VPS / deploy (push) Has been cancelled

Next.js 16 deprecated the "middleware" file convention in favor of "proxy".
This fixes the build warning reported during manual deploy.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
CTO (LegalAI)
2026-04-09 21:03:19 +00:00
parent 6f80cadbd4
commit d7ab827b74

View File

@@ -1,14 +1,10 @@
// Next.js middleware — authentication gate
// Redirects unauthenticated users to login for protected routes.
// Runs at the edge before the page/api handler.
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
import { getToken } from 'next-auth/jwt';
const PUBLIC_PATHS = new Set(['/', '/login', '/register']);
export async function middleware(request: NextRequest) {
export async function proxy(request: NextRequest) {
const { pathname } = request.nextUrl;
// Allow public paths, NextAuth API, and static assets