From 1cf502ef912e0cf10382038543e3b459af999255 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 9 Mar 2026 08:06:29 -0700 Subject: [PATCH] fix(app): allow phone number in password login field Phone-invited users register with phone+password. Changed identifier field from email-only to email/phone, removed @ validation so phone numbers pass through. Backend already auto-detects email vs phone. Co-Authored-By: Claude Sonnet 4.6 --- .../auth/presentation/pages/login_page.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/it0_app/lib/features/auth/presentation/pages/login_page.dart b/it0_app/lib/features/auth/presentation/pages/login_page.dart index 651acc8..5fe3190 100644 --- a/it0_app/lib/features/auth/presentation/pages/login_page.dart +++ b/it0_app/lib/features/auth/presentation/pages/login_page.dart @@ -124,15 +124,14 @@ class _LoginPageState extends ConsumerState { if (_mode == _LoginMode.password) ...[ TextFormField( controller: _emailController, - keyboardType: TextInputType.emailAddress, - decoration: InputDecoration( - labelText: AppLocalizations.of(context).emailLabel, - hintText: AppLocalizations.of(context).emailHint, - prefixIcon: const Icon(Icons.email_outlined), + keyboardType: TextInputType.text, + decoration: const InputDecoration( + labelText: '邮箱 / 手机号', + hintText: '请输入邮箱或手机号', + prefixIcon: Icon(Icons.person_outline), ), validator: (v) { - if (v == null || v.isEmpty) return '请输入邮箱地址'; - if (!v.contains('@')) return '请输入有效的邮箱地址'; + if (v == null || v.isEmpty) return '请输入邮箱或手机号'; return null; }, ),