Refactor: Complete type safety migration

This commit is contained in:
gpt-engineer-app[bot]
2025-10-17 13:22:39 +00:00
parent 3d61d738f2
commit efc33a7dda
10 changed files with 212 additions and 161 deletions

View File

@@ -8,6 +8,7 @@ import { Separator } from '@/components/ui/separator';
import { Zap, Mail, Lock, User, Eye, EyeOff } from 'lucide-react';
import { supabase } from '@/integrations/supabase/client';
import { useToast } from '@/hooks/use-toast';
import { getErrorMessage } from '@/lib/errorHandler';
import { TurnstileCaptcha } from './TurnstileCaptcha';
import { notificationService } from '@/lib/notificationService';
import { useCaptchaBypass } from '@/hooks/useCaptchaBypass';
@@ -102,12 +103,12 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
await new Promise(resolve => setTimeout(resolve, 100));
onOpenChange(false);
} catch (error: any) {
} catch (error) {
setSignInCaptchaKey(prev => prev + 1);
toast({
variant: "destructive",
title: "Sign in failed",
description: error.message
description: getErrorMessage(error)
});
} finally {
setLoading(false);
@@ -230,12 +231,12 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
description: "Please check your email to verify your account."
});
onOpenChange(false);
} catch (error: any) {
} catch (error) {
setCaptchaKey(prev => prev + 1);
toast({
variant: "destructive",
title: "Sign up failed",
description: error.message
description: getErrorMessage(error)
});
} finally {
setLoading(false);
@@ -269,11 +270,11 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
description: "Check your email for a sign-in link."
});
onOpenChange(false);
} catch (error: any) {
} catch (error) {
toast({
variant: "destructive",
title: "Failed to send magic link",
description: error.message
description: getErrorMessage(error)
});
} finally {
setMagicLinkLoading(false);
@@ -293,11 +294,11 @@ export function AuthModal({ open, onOpenChange, defaultTab = 'signin' }: AuthMod
}
});
if (error) throw error;
} catch (error: any) {
} catch (error) {
toast({
variant: "destructive",
title: "Social sign in failed",
description: error.message
description: getErrorMessage(error)
});
}
};