From 84448c6b6020e008e2a04d10b527e13ebd11b07e Mon Sep 17 00:00:00 2001 From: Sachin Date: Fri, 16 Aug 2024 20:01:31 +0530 Subject: [PATCH] fix vercel depbuild issue --- middleware.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/middleware.ts b/middleware.ts index 0c7269e96..a2cb22578 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(); +}