refactor: migrate middleware.ts to proxy.ts (Next.js 16)

This commit is contained in:
2026-01-24 08:11:02 +01:00
parent 10b78e46cd
commit 123c225766

16
proxy.ts Normal file
View File

@@ -0,0 +1,16 @@
import { neonAuthMiddleware } from "@neondatabase/auth/next/server";
// Next.js 16 renamed middleware to proxy
// neonAuthMiddleware returns a middleware function, we export it as proxy
export const proxy = neonAuthMiddleware({
// Redirects unauthenticated users to sign-in page
loginUrl: "/auth/sign-in",
});
export const config = {
matcher: [
// Protected routes requiring authentication
"/dashboard/:path*",
"/account/:path*",
],
};