diff --git a/src/app/(auth)/signup/page.tsx b/src/app/(auth)/signup/page.tsx index 7685d0a..14a6fc5 100644 --- a/src/app/(auth)/signup/page.tsx +++ b/src/app/(auth)/signup/page.tsx @@ -94,6 +94,16 @@ export default function SignUpPage() { }; const handleSocialLogin = (provider: 'google' | 'facebook' | 'twitter') => { + // If agent, require agent type selection + if (userType === 'AGENT' && !selectedAgentTypeId) { + setError('Please select an agent type before signing up'); + return; + } + // Set cookies with selected role and agent type so server-side auth callback can read them + document.cookie = `socialAuthRole=${userType};path=/;max-age=300;SameSite=Lax`; + if (userType === 'AGENT' && selectedAgentTypeId) { + document.cookie = `socialAuthAgentTypeId=${selectedAgentTypeId};path=/;max-age=300;SameSite=Lax`; + } signIn(provider, { callbackUrl: '/' }); }; @@ -317,14 +327,6 @@ export default function SignUpPage() { {/* Social Login Icons */}
- {/* Apple */} - - {/* Google */}