make auth optional

This commit is contained in:
Ramnique Singh 2025-03-27 07:58:15 +05:30
parent 4b3395ea3a
commit 861bae11a6
9 changed files with 73 additions and 27 deletions

View file

@ -34,6 +34,10 @@ export async function middleware(request: NextRequest, event: NextFetchEvent) {
}
if (request.nextUrl.pathname.startsWith('/projects')) {
// Skip auth check if USE_AUTH is not enabled
if (process.env.USE_AUTH !== 'true') {
return NextResponse.next();
}
return auth0MiddlewareHandler(request, event);
}