Files
Junaid 7adb0f934a build(deps): upgrade Next.js to v16 and enable React Compiler
- Upgrade Next.js from 15.3.2 to 16.0.3
- Enable React Compiler with babel-plugin-react-compiler
- Update tsconfig.json to use react-jsx for compiler compatibility
- Remove turbopack from dev script
- Remove eslint.ignoreDuringBuilds configuration
- Refactor auth cookie handling to avoid double await
2025-11-15 11:10:17 -06:00

28 lines
954 B
TypeScript

import { handleDashboardRoutes, getAuthenticatedUser } from '@/features/dashboard/middleware';
import { NextRequest, NextResponse } from 'next/server';
export async function proxy(request: NextRequest) {
// Get authenticated user once
const { user, redirectToInit } = await getAuthenticatedUser(request);
// Let dashboard handler manage its routes
const dashboardResponse = await handleDashboardRoutes(request, user, redirectToInit);
if (dashboardResponse) return dashboardResponse;
// Continue with existing middleware logic {
// Add any middleware logic here if needed
return NextResponse.next();
}
export const config = {
matcher: [
/*
* Match all request paths except for the ones starting with:
* - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.svg (favicon file)
*/
'/((?!api|_next/static|_next/image|favicon.svg).*)',
],
};