Loading...
@@ -112,8 +125,9 @@ export default function ProtectedRoute({ children }: ProtectedRouteProps) {
);
}
- // Redirect to signin if not authenticated
+ // Redirect to signin if not authenticated (after initialization period)
if (!isAuthenticated) {
+ console.log('ProtectedRoute: Not authenticated, redirecting to signin');
return
;
}
diff --git a/frontend/src/components/auth/SignUpFormSimplified.tsx b/frontend/src/components/auth/SignUpFormSimplified.tsx
index 75ef6899..d737c181 100644
--- a/frontend/src/components/auth/SignUpFormSimplified.tsx
+++ b/frontend/src/components/auth/SignUpFormSimplified.tsx
@@ -38,6 +38,7 @@ export default function SignUpFormSimplified({ planDetails: planDetailsProp, pla
email: '',
password: '',
accountName: '',
+ billingCountry: 'US', // Default to US for payment method filtering
});
const [selectedPaymentMethod, setSelectedPaymentMethod] = useState
('');
@@ -91,7 +92,8 @@ export default function SignUpFormSimplified({ planDetails: planDetailsProp, pla
setPaymentMethodsLoading(true);
try {
const API_BASE_URL = import.meta.env.VITE_BACKEND_URL || 'https://api.igny8.com/api';
- const response = await fetch(`${API_BASE_URL}/v1/billing/admin/payment-methods/`);
+ const country = formData.billingCountry || 'US';
+ const response = await fetch(`${API_BASE_URL}/v1/billing/admin/payment-methods/?country=${country}`);
if (!response.ok) {
throw new Error('Failed to load payment methods');
@@ -125,7 +127,7 @@ export default function SignUpFormSimplified({ planDetails: planDetailsProp, pla
};
loadPaymentMethods();
- }, [isPaidPlan]);
+ }, [isPaidPlan, formData.billingCountry]);
const handleChange = (e: React.ChangeEvent) => {
const { name, value } = e.target;
@@ -171,6 +173,7 @@ export default function SignUpFormSimplified({ planDetails: planDetailsProp, pla
registerPayload.payment_method = selectedPaymentMethod;
// Use email as billing email by default
registerPayload.billing_email = formData.email;
+ registerPayload.billing_country = formData.billingCountry;
}
const user = await register(registerPayload) as any;
@@ -314,6 +317,31 @@ export default function SignUpFormSimplified({ planDetails: planDetailsProp, pla
{/* Payment Method Selection for Paid Plans */}
{isPaidPlan && (
+ {/* Country Selection */}
+
+
+
+
+ Payment methods will be filtered by your country
+
+
+