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.
5 lines
109 B
JavaScript
5 lines
109 B
JavaScript
export { proxy } from "./dashboardGuard";
|
|
|
|
export const config = {
|
|
matcher: ["/", "/dashboard/:path*"],
|
|
};
|