mirror of https://github.com/kortix-ai/suna.git
fix(middleware): improve case-insensitive env mode checking
Simplify the local mode detection logic by using toLowerCase() instead of explicit case matching. This makes the code more robust and handles any case variation of NEXT_PUBLIC_ENV_MODE consistently. The setup.py script generates "LOCAL" (uppercase) while developers might use "local" (lowercase), so this ensures both work reliably.
This commit is contained in:
parent
fea66b0266
commit
a7c11e97c5
|
@ -66,7 +66,7 @@ export async function middleware(request: NextRequest) {
|
|||
return NextResponse.redirect(url);
|
||||
}
|
||||
|
||||
const isLocalMode = process.env.NEXT_PUBLIC_ENV_MODE === 'local'
|
||||
const isLocalMode = process.env.NEXT_PUBLIC_ENV_MODE?.toLowerCase() === 'local'
|
||||
if (isLocalMode) {
|
||||
return supabaseResponse;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue