@djangocfg/api 2.1.565 → 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.cjs CHANGED
@@ -975,11 +975,10 @@ var _storageMode = "localStorage";
975
975
  var _storage = backendFor(_storageMode);
976
976
  function detectLocale() {
977
977
  try {
978
- if (typeof document !== "undefined") {
979
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
980
- const locale = m?.[1];
981
- if (locale !== void 0) return decodeURIComponent(locale);
982
- }
978
+ if (typeof document === "undefined") return null;
979
+ const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
980
+ const locale = m?.[1];
981
+ if (locale !== void 0) return decodeURIComponent(locale);
983
982
  if (typeof navigator !== "undefined" && navigator.language) {
984
983
  return navigator.language;
985
984
  }
@@ -1111,7 +1110,15 @@ function ensureStorageSync() {
1111
1110
  window.addEventListener(SESSION_SYNC_EVENT, () => notifySessionChanged());
1112
1111
  }
1113
1112
  __name(ensureStorageSync, "ensureStorageSync");
1114
- var _sessionExpiredHandlers = /* @__PURE__ */ new Set();
1113
+ var SESSION_EXPIRED_REGISTRY = `cfg-auth:expired-handlers:${ACCESS_KEY}`;
1114
+ var _sessionExpiredHandlers = (() => {
1115
+ const g = globalThis;
1116
+ const existing = g[SESSION_EXPIRED_REGISTRY];
1117
+ if (existing instanceof Set) return existing;
1118
+ const created = /* @__PURE__ */ new Set();
1119
+ g[SESSION_EXPIRED_REGISTRY] = created;
1120
+ return created;
1121
+ })();
1115
1122
  var _client = null;
1116
1123
  function pushClientConfig() {
1117
1124
  if (!_client) return;