fix(cli): add +91 prefix automatically for login

Description

Problem

The CLI login flow required users to manually include the +91 country code while entering their mobile number.

However, in the GUI application, the +91 prefix is automatically added on the client side.

This mismatch caused:

  • Login failures for CLI users
  • Confusion for users familiar with the GUI

Solution

Updated the CLI login implementation to normalize phone number input:

  • Accepts 10-digit mobile numbers from users
  • Automatically prepends +91 if the prefix is missing

Before vs After

Scenario Before After
User Input 9876543210 9876543210
Sent to API 9876543210 +919876543210
Result Login failed Login success

Changes Made

  • Updated input label:
    Phone numberPhone number (+91)
  • Added logic to prepend +91 if not already present
  • Ensured compatibility for numbers already containing +91

Impact

  • Aligns CLI behavior with GUI
  • Improves user experience
  • Prevents login failures due to format mismatch

Testing

Test Cases:

  1. Input: 9876543210

    • Expected: +919876543210 sent to API
  2. Input: +919876543210

    • Expected: remains unchanged
Edited by POORNA CHANDRA SAI TEJA KUMPATLA

Merge request reports

Loading