mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 21:06:59 -05:00
Fix error handling
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { useState } from "react";
|
||||
import { supabase } from "@/lib/supabaseClient";
|
||||
import { useToast } from "@/hooks/use-toast";
|
||||
import { getErrorMessage } from "@/lib/errorHandler";
|
||||
import { handleError } from "@/lib/errorHandler";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/input-otp";
|
||||
@@ -45,10 +45,13 @@ export function MFAChallenge({ factorId, onSuccess, onCancel }: MFAChallengeProp
|
||||
onSuccess();
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Verification Failed",
|
||||
description: getErrorMessage(error) || "Invalid code. Please try again.",
|
||||
handleError(error, {
|
||||
action: 'MFA Verification',
|
||||
metadata: {
|
||||
factorId,
|
||||
codeLength: code.length,
|
||||
context: 'MFAChallenge'
|
||||
}
|
||||
});
|
||||
setCode("");
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user