enforce strict 10-digit phone input and support login without manual +91 prefix
MR description
This MR improves login phone handling and validation.
Changes
- Enforced strict 10-digit phone input on login page:
- numeric-only input normalization
- hard max length of 10 digits
- validation error if phone is not exactly 10 digits
- Updated login request flow to accept 10-digit user input while preserving backend compatibility:
- app now tries
+91<10digits>and<10digits>automatically - users no longer need to type
+91manually
- app now tries
- Profile user number display now uses normalized 10-digit login value.
Files changed
src/App.tsx
Why
Users had to manually enter +91 for successful login. This caused friction and inconsistent input behavior. The new flow ensures users can log in using only a 10-digit number while keeping API integration intact.
Validation done
- Manual code-path verification for:
- non-digit characters removal
- 11th digit prevention
- exact 10-digit submit enforcement
- login fallback attempts with and without
+91