@progalaxyelabs/ngx-stonescriptphp-client 1.18.0 → 1.18.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.
@@ -2110,7 +2110,14 @@ class TenantLoginComponent {
2110
2110
  }
2111
2111
  // Auto-select if user has only one tenant
2112
2112
  if (this.memberships.length === 1 && this.autoSelectSingleTenant) {
2113
- await this.selectAndContinue(this.memberships[0]);
2113
+ const m = this.memberships[0];
2114
+ // If login already returned a tenant-scoped token (via membership in response),
2115
+ // just emit — no need to call select-tenant again.
2116
+ if (loginResult?.membership) {
2117
+ this.tenantSelected.emit({ tenantId: m.tenant_id, tenantSlug: m.slug, role: m.role });
2118
+ return;
2119
+ }
2120
+ await this.selectAndContinue(m);
2114
2121
  }
2115
2122
  else {
2116
2123
  // Show tenant selector