mirror of
https://github.com/openshiporg/openship.git
synced 2026-06-19 07:35:55 +00:00
7adb0f934a
- 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
28 lines
954 B
TypeScript
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).*)',
|
|
],
|
|
}; |