Implement type safety and JSONB elimination

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 13:29:22 +00:00
parent efc33a7dda
commit d54b8a9ae4
10 changed files with 144 additions and 69 deletions

View File

@@ -1,6 +1,7 @@
import { useState } from 'react';
import { supabase } from '@/integrations/supabase/client';
import { toast } from 'sonner';
import { getErrorMessage } from '@/lib/errorHandler';
import {
AlertDialog,
AlertDialogAction,
@@ -60,9 +61,9 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
toast.success('Password verified');
setStep('totp');
} catch (error: any) {
} catch (error) {
console.error('Password verification failed:', error);
toast.error('Invalid password. Please try again.');
toast.error(getErrorMessage(error));
} finally {
setLoading(false);
}
@@ -94,9 +95,9 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
toast.success('TOTP code verified');
setStep('confirm');
} catch (error: any) {
} catch (error) {
console.error('TOTP verification failed:', error);
toast.error('Invalid code. Please try again.');
toast.error(getErrorMessage(error));
} finally {
setLoading(false);
}
@@ -140,9 +141,9 @@ export function MFARemovalDialog({ open, onOpenChange, factorId, onSuccess }: MF
toast.success('Two-factor authentication has been disabled');
handleClose();
onSuccess();
} catch (error: any) {
} catch (error) {
console.error('MFA removal failed:', error);
toast.error('Failed to disable MFA. Please try again.');
toast.error(getErrorMessage(error));
} finally {
setLoading(false);
}