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.js
CHANGED
|
@@ -1809,7 +1809,16 @@ var RefreshFlow = class {
|
|
|
1809
1809
|
error: error instanceof Error ? error.message : String(error)
|
|
1810
1810
|
});
|
|
1811
1811
|
}
|
|
1812
|
-
const
|
|
1812
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(getUrl(), runtime.configProvider);
|
|
1813
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1814
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1815
|
+
const tenantKey = (tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1816
|
+
log.debug("[RefreshFlow] Tenant key resolved", {
|
|
1817
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1818
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1819
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1820
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1821
|
+
});
|
|
1813
1822
|
if (!tenantKey) {
|
|
1814
1823
|
throw new SanitizedError(
|
|
1815
1824
|
"TENANT_KEY_RESOLUTION_FAILED",
|
|
@@ -1843,7 +1852,17 @@ var TenantSwitchFlow = class {
|
|
|
1843
1852
|
emitAuthEvent(AuthEventNames.TENANT_SWITCHED, { tenantKey: newTenantKey ?? void 0 });
|
|
1844
1853
|
removeStorage(getStorageKey("tenant_switched"));
|
|
1845
1854
|
removeStorage(getStorageKey("new_tenant_key"));
|
|
1846
|
-
const
|
|
1855
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(getUrl(), runtime.configProvider);
|
|
1856
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1857
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1858
|
+
const tenantKey = (newTenantKey || tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1859
|
+
log.debug("[TenantSwitchFlow] Tenant key resolved", {
|
|
1860
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1861
|
+
fromNewTenantKey: newTenantKey ?? "(null)",
|
|
1862
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1863
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1864
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1865
|
+
});
|
|
1847
1866
|
if (!tenantKey) {
|
|
1848
1867
|
throw new SanitizedError(
|
|
1849
1868
|
"TENANT_KEY_RESOLUTION_FAILED",
|
|
@@ -1883,8 +1902,16 @@ var LoginFlow = class {
|
|
|
1883
1902
|
}
|
|
1884
1903
|
const wasStateMismatch = getStorage(getStorageKey("state_mismatch")) === "true";
|
|
1885
1904
|
if (wasStateMismatch) removeStorage(getStorageKey("state_mismatch"));
|
|
1886
|
-
const
|
|
1887
|
-
|
|
1905
|
+
const tenantKeyFromRuntime = getTenantKeyFromRuntime(url, runtime.configProvider);
|
|
1906
|
+
const tenantKeyFromStorage = getStorage(getStorageKey("tenant_key"));
|
|
1907
|
+
const tenantKeyFromConfig = runtime.configProvider.getClientCode?.() ?? "";
|
|
1908
|
+
const tenantKey = (tenantKeyFromRuntime || tenantKeyFromStorage || tenantKeyFromConfig)?.trim();
|
|
1909
|
+
log.debug("[LoginFlow] Tenant key resolved", {
|
|
1910
|
+
tenantKey: tenantKey ?? "(null)",
|
|
1911
|
+
fromRuntime: tenantKeyFromRuntime ?? "(null)",
|
|
1912
|
+
fromStorage: tenantKeyFromStorage ?? "(null)",
|
|
1913
|
+
fromConfig: tenantKeyFromConfig || "(null)"
|
|
1914
|
+
});
|
|
1888
1915
|
if (!tenantKey) {
|
|
1889
1916
|
throw new SanitizedError(
|
|
1890
1917
|
"TENANT_KEY_RESOLUTION_FAILED",
|