/**
 * Supabase Client Configuration
 * Usado para processar Magic Links e gerenciar sessões
 */

import { createClient } from "@supabase/supabase-js";

const SUPABASE_URL = "https://beffilzgxsdvvrlitqtw.supabase.co";
const SUPABASE_ANON_KEY =
  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJlZmZpbHpneHNkdnZybGl0cXR3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjM2ODIyMTUsImV4cCI6MjA3OTI1ODIxNX0.jzYLs5m5OerXp6xTTXmuHki2j41jcp4COQRYwWAZLpQ";

export const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {
  auth: {
    storage: localStorage,
    persistSession: true,
    autoRefreshToken: true,
    detectSessionInUrl: true, // Importante para Magic Link
  },
});
