diff --git a/components/AuthScreen.tsx b/components/AuthScreen.tsx index f68718b..4762699 100644 --- a/components/AuthScreen.tsx +++ b/components/AuthScreen.tsx @@ -4,8 +4,8 @@ import { Lock, User, Mail, Briefcase, ArrowRight, AlertCircle } from 'lucide-rea interface AuthScreenProps { settings: AppSettings; - onClientLogin: (email: string, password: string) => boolean; - onAgentLogin: (email: string, password: string) => boolean; + onClientLogin: (email: string, password: string) => Promise; + onAgentLogin: (email: string, password: string) => Promise; onClientRegister: (name: string, email: string, password: string, company: string) => void; } @@ -20,19 +20,19 @@ export const AuthScreen: React.FC = ({ settings, onClientLogin, const [name, setName] = useState(''); const [company, setCompany] = useState(''); - const handleSubmit = (e: React.FormEvent) => { + const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(null); let success = false; if (activeTab === 'agent') { - success = onAgentLogin(email, password); + success = await onAgentLogin(email, password); } else { if (isRegistering) { onClientRegister(name, email, password, company); success = true; // Assume success for mock registration } else { - success = onClientLogin(email, password); + success = await onClientLogin(email, password); } }