chore: fix deployment eval error and add middleware safety checks

This commit is contained in:
2025-12-18 00:48:13 +01:00
parent 77814ea3cd
commit 728d53c121
9 changed files with 30 additions and 12 deletions

View File

@@ -1,6 +1,12 @@
import { createClient } from '@supabase/supabase-js';
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!;
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!;
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL;
const supabaseAnonKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;
export const supabase = createClient(supabaseUrl, supabaseAnonKey);
if (!supabaseUrl || !supabaseAnonKey) {
console.error('Migration Error: Supabase credentials are not set.');
}
export const supabase = (supabaseUrl && supabaseAnonKey)
? createClient(supabaseUrl, supabaseAnonKey)
: null as any; // Fallback or handle null in services