@djangocfg/api 2.1.563 → 2.1.566

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/hooks.mjs CHANGED
@@ -940,11 +940,10 @@ var _storageMode = "localStorage";
940
940
  var _storage = backendFor(_storageMode);
941
941
  function detectLocale() {
942
942
  try {
943
- if (typeof document !== "undefined") {
944
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
945
- const locale = m?.[1];
946
- if (locale !== void 0) return decodeURIComponent(locale);
947
- }
943
+ if (typeof document === "undefined") return null;
944
+ const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
945
+ const locale = m?.[1];
946
+ if (locale !== void 0) return decodeURIComponent(locale);
948
947
  if (typeof navigator !== "undefined" && navigator.language) {
949
948
  return navigator.language;
950
949
  }
@@ -1076,7 +1075,15 @@ function ensureStorageSync() {
1076
1075
  window.addEventListener(SESSION_SYNC_EVENT, () => notifySessionChanged());
1077
1076
  }
1078
1077
  __name(ensureStorageSync, "ensureStorageSync");
1079
- var _sessionExpiredHandlers = /* @__PURE__ */ new Set();
1078
+ var SESSION_EXPIRED_REGISTRY = `cfg-auth:expired-handlers:${ACCESS_KEY}`;
1079
+ var _sessionExpiredHandlers = (() => {
1080
+ const g = globalThis;
1081
+ const existing = g[SESSION_EXPIRED_REGISTRY];
1082
+ if (existing instanceof Set) return existing;
1083
+ const created = /* @__PURE__ */ new Set();
1084
+ g[SESSION_EXPIRED_REGISTRY] = created;
1085
+ return created;
1086
+ })();
1080
1087
  var _client = null;
1081
1088
  function pushClientConfig() {
1082
1089
  if (!_client) return;