Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion middleware.ts
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
export { auth as middleware} from "@/auth"
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();
}