diff --git a/apps/edr-passenger-web/backoffice/src/app/login/page.tsx b/apps/edr-passenger-web/backoffice/src/app/login/page.tsx index 4f0098792..899e8cd11 100644 --- a/apps/edr-passenger-web/backoffice/src/app/login/page.tsx +++ b/apps/edr-passenger-web/backoffice/src/app/login/page.tsx @@ -20,13 +20,15 @@ const features = [ ]; export default function LoginPage() { - const [email, setEmail] = useState(''); + // Accepts an email address, phone number, or username — sent to the IAM in + // the `email` field either way (the backend contract does not change). + const [identifier, setIdentifier] = useState(''); const [password, setPassword] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [showPassword, setShowPassword] = useState(false); const [isMounted, setIsMounted] = useState(false); - const [emailFocused, setEmailFocused] = useState(false); + const [identifierFocused, setIdentifierFocused] = useState(false); const [passwordFocused, setPasswordFocused] = useState(false); const [view, setView] = useState<'login' | 'forgot'>('login'); @@ -47,7 +49,7 @@ export default function LoginPage() { setLoading(true); setError(''); try { - await login(email, password); + await login(identifier.trim(), password); router.push('/dashboard'); } catch (err: any) { const msg = err.message || err.response?.data?.message || ''; @@ -152,26 +154,29 @@ export default function LoginPage() {