Square Payments

This commit is contained in:
James Pattinson
2025-11-12 16:09:38 +00:00
parent be2426c078
commit 0f74333a22
19 changed files with 1828 additions and 85 deletions
+10 -1
View File
@@ -27,7 +27,16 @@ const Login: React.FC = () => {
await authService.login(formData);
navigate('/dashboard');
} catch (err: any) {
setError(err.response?.data?.detail || 'Login failed. Please check your credentials.');
console.error('Login error:', err.response?.data); // Debug log
const errorDetail = err.response?.data?.detail;
if (typeof errorDetail === 'string') {
setError(errorDetail);
} else if (errorDetail && typeof errorDetail === 'object') {
// Handle validation error objects
setError('Login failed. Please check your credentials.');
} else {
setError('Login failed. Please check your credentials.');
}
} finally {
setLoading(false);
}