feat: Implement plan for bug fixes

This commit is contained in:
gpt-engineer-app[bot]
2025-10-21 13:27:23 +00:00
parent 827f0f8ea5
commit ce6c9d6866
14 changed files with 94 additions and 59 deletions

View File

@@ -1,5 +1,6 @@
import { useState, useEffect } from 'react';
import { supabase } from '@/integrations/supabase/client';
import { invokeWithTracking } from '@/lib/edgeFunctionTracking';
import { toast } from 'sonner';
import { getSessionAAL } from '@/types/supabase-session';
import { getErrorMessage } from '@/lib/errorHandler';
@@ -142,9 +143,11 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
setLoading(true);
try {
// Phase 3: Call edge function instead of direct unenroll
const { data, error } = await supabase.functions.invoke('mfa-unenroll', {
body: { factorId }
});
const { data, error, requestId } = await invokeWithTracking(
'mfa-unenroll',
{ factorId },
(await supabase.auth.getUser()).data.user?.id
);
if (error) throw error;
if (data?.error) throw new Error(data.error);