@progalaxyelabs/ngx-stonescriptphp-client 1.23.0 → 1.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2443,7 +2443,7 @@ class TenantLoginComponent {
2443
2443
  // Normalize: auto-prepend +91 for 10-digit Indian numbers
2444
2444
  if (type === 'phone') {
2445
2445
  const digits = raw.replace(/\D/g, '');
2446
- this.otpNormalizedIdentifier = digits.length === 10 ? `+91${digits}` : (raw.startsWith('+') ? raw : `+${digits}`);
2446
+ this.otpNormalizedIdentifier = digits.length === 10 ? `+91${digits}` : `+${digits}`;
2447
2447
  }
2448
2448
  else {
2449
2449
  this.otpNormalizedIdentifier = raw;
@@ -2472,6 +2472,8 @@ class TenantLoginComponent {
2472
2472
  }
2473
2473
  /** Verify the entered OTP code */
2474
2474
  async onOtpVerify() {
2475
+ if (this.loading)
2476
+ return;
2475
2477
  const code = this.otpCode;
2476
2478
  if (code.length < 6) {
2477
2479
  this.error = 'Please enter the complete 6-digit code';
@@ -2520,6 +2522,14 @@ class TenantLoginComponent {
2520
2522
  try {
2521
2523
  const result = await this.auth.identityRegister(this.otpVerifiedToken, name);
2522
2524
  if (!result.success) {
2525
+ // If token expired, restart OTP flow
2526
+ if (result.message?.includes('expired') || result.message?.includes('Invalid')) {
2527
+ this.error = 'Session expired. Please verify again.';
2528
+ this.otpStep = 'identifier';
2529
+ this.otpVerifiedToken = '';
2530
+ this.otpDisplayName = '';
2531
+ return;
2532
+ }
2523
2533
  this.error = result.message || 'Registration failed';
2524
2534
  return;
2525
2535
  }