diff --git a/api/experiments.ts b/api/experiments.ts index dec671e..0adffc3 100644 --- a/api/experiments.ts +++ b/api/experiments.ts @@ -4,7 +4,13 @@ import { Experiment, ExperimentCreateInput } from '../types'; const supabase = createClient( process.env.SUPABASE_URL || '', - process.env.SUPABASE_SERVICE_KEY || '' + process.env.SUPABASE_SERVICE_KEY || '', + { + auth: { + autoRefreshToken: false, + persistSession: false + } + } ); export default async function handler(req: VercelRequest, res: VercelResponse) { diff --git a/services/supabase.ts b/services/supabase.ts index 1c22e42..6551667 100644 --- a/services/supabase.ts +++ b/services/supabase.ts @@ -14,7 +14,15 @@ const getClient = (): SupabaseClient => { if (!supabaseUrl || !supabaseAnonKey) { throw new Error('Supabase credentials not configured. Add SUPABASE_URL and SUPABASE_ANON_KEY to environment variables.'); } - _client = createClient(supabaseUrl, supabaseAnonKey); + // Disable auth persistence to avoid LockManager timeout issues + _client = createClient(supabaseUrl, supabaseAnonKey, { + auth: { + autoRefreshToken: false, + persistSession: false, + detectSessionInUrl: false, + storage: false as any + } + }); } return _client; };