From 4e92a66379e33cca526e325c76c7d8c44c39e668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thi=C3=AAn=20To=C3=A1n?= Date: Mon, 2 Mar 2026 15:21:50 +0700 Subject: [PATCH] fix(auth): wire up dashboard auth guard as Next.js proxy (#227) Dashboard routes were accessible without authentication because dashboardGuard.js was not connected to Next.js middleware pipeline. Created src/proxy.js to export the auth guard using Next.js 16 proxy convention. Now /dashboard routes properly redirect to /login when auth_token cookie is missing or invalid. --- src/proxy.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/proxy.js diff --git a/src/proxy.js b/src/proxy.js new file mode 100644 index 00000000..0ea66058 --- /dev/null +++ b/src/proxy.js @@ -0,0 +1,5 @@ +export { proxy } from "./dashboardGuard"; + +export const config = { + matcher: ["/", "/dashboard/:path*"], +};