mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 21:06:59 -05:00
Implement type safety and JSONB elimination
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
|
||||
@@ -25,11 +26,11 @@ export function MFAChallenge({ factorId, onSuccess, onCancel }: MFAChallengeProp
|
||||
const { data, error } = await supabase.auth.mfa.challenge({ factorId });
|
||||
if (error) throw error;
|
||||
setChallengeId(data.id);
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "MFA Challenge Failed",
|
||||
description: error.message
|
||||
description: getErrorMessage(error)
|
||||
});
|
||||
onCancel();
|
||||
}
|
||||
@@ -58,11 +59,11 @@ export function MFAChallenge({ factorId, onSuccess, onCancel }: MFAChallengeProp
|
||||
});
|
||||
onSuccess();
|
||||
}
|
||||
} catch (error: any) {
|
||||
} catch (error) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Verification Failed",
|
||||
description: error.message || "Invalid code. Please try again."
|
||||
description: getErrorMessage(error) || "Invalid code. Please try again."
|
||||
});
|
||||
setCode('');
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user