Refactor: Improve validation schemas

This commit is contained in:
gpt-engineer-app[bot]
2025-10-14 17:52:50 +00:00
parent a255442616
commit 7a6273111d
8 changed files with 113 additions and 35 deletions

View File

@@ -157,9 +157,17 @@ export function EmailChangeDialog({ open, onOpenChange, currentEmail, userId }:
setStep('success');
} catch (error: any) {
console.error('Email change error:', error);
toast.error('Failed to change email', {
description: error.message || 'Please try again.',
});
// Handle rate limiting specifically
if (error.message?.includes('rate limit') || error.status === 429) {
toast.error('Too Many Attempts', {
description: 'Please wait a few minutes before trying again.',
});
} else {
toast.error('Failed to change email', {
description: error.message || 'Please try again.',
});
}
} finally {
setLoading(false);
}