fix: rename middleware.ts to proxy.ts for Next.js 16 compatibility
Some checks failed
Deploy to VPS / deploy (push) Has been cancelled
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:
@@ -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
|
||||
Reference in New Issue
Block a user