mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 01:11:13 -05:00
Refactor: Complete type safety migration
This commit is contained in:
@@ -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)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user