tenneo-auth-plugin 0.1.11 → 1.0.0
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.
- package/dist/index.js +31 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1803,7 +1803,16 @@ var RefreshFlow = class {
|
|
|
1803
1803
|
error: error instanceof Error ? error.message : String(error)
|
|
1804
1804
|
});
|
|
1805
1805
|
}
|
|
1806
|
-
const
|
|
1806
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(getUrl(), runtime.configProvider);
|
|
1807
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1808
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1809
|
+
const tenantKey = (tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1810
|
+
log.debug("[RefreshFlow] Tenant key resolved", {
|
|
1811
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1812
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1813
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1814
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1815
|
+
});
|
|
1807
1816
|
if (!tenantKey) {
|
|
1808
1817
|
throw new SanitizedError(
|
|
1809
1818
|
"TENANT_KEY_RESOLUTION_FAILED",
|
|
@@ -1837,7 +1846,17 @@ var TenantSwitchFlow = class {
|
|
|
1837
1846
|
emitAuthEvent(AuthEventNames.TENANT_SWITCHED, { tenantKey: newTenantKey ?? void 0 });
|
|
1838
1847
|
removeStorage(getStorageKey("tenant_switched"));
|
|
1839
1848
|
removeStorage(getStorageKey("new_tenant_key"));
|
|
1840
|
-
const
|
|
1849
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(getUrl(), runtime.configProvider);
|
|
1850
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1851
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1852
|
+
const tenantKey = (newTenantKey || tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1853
|
+
log.debug("[TenantSwitchFlow] Tenant key resolved", {
|
|
1854
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1855
|
+
fromNewTenantKey: newTenantKey ?? "(null)",
|
|
1856
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1857
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1858
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1859
|
+
});
|
|
1841
1860
|
if (!tenantKey) {
|
|
1842
1861
|
throw new SanitizedError(
|
|
1843
1862
|
"TENANT_KEY_RESOLUTION_FAILED",
|
|
@@ -1877,8 +1896,16 @@ var LoginFlow = class {
|
|
|
1877
1896
|
}
|
|
1878
1897
|
const wasStateMismatch = getStorage(getStorageKey("state_mismatch")) === "true";
|
|
1879
1898
|
if (wasStateMismatch) removeStorage(getStorageKey("state_mismatch"));
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1899
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(url, runtime.configProvider);
|
|
1900
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1901
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1902
|
+
const tenantKey = (tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1903
|
+
log.debug("[LoginFlow] Tenant key resolved", {
|
|
1904
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1905
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1906
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1907
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1908
|
+
});
|
|
1882
1909
|
if (!tenantKey) {
|
|
1883
1910
|
throw new SanitizedError(
|
|
1884
1911
|
"TENANT_KEY_RESOLUTION_FAILED",
|