diff --git a/middleware.ts b/middleware.ts index 0c7269e9..a2cb2257 100644 --- a/middleware.ts +++ b/middleware.ts @@ -1 +1,21 @@ -export { auth as middleware} from "@/auth" \ No newline at end of file +import { NextResponse } from 'next/server'; +import { auth } from '@/auth'; + +export const config = { + unstable_allowDynamic: [ + "**/node_modules/@react-email*/**/*.mjs*", + ], +}; + +export function middleware(req:any) { + // Call the auth middleware first + const response = auth(req); + + // If auth middleware doesn't return a response, continue to the next middleware + if (response) { + return response; + } + + // If no response from auth, proceed with the Next.js response + return NextResponse.next(); +}