@djangocfg/api 2.1.565 → 2.1.567

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/clients.mjs CHANGED
@@ -143,11 +143,10 @@ var _storageMode = "localStorage";
143
143
  var _storage = backendFor(_storageMode);
144
144
  function detectLocale() {
145
145
  try {
146
- if (typeof document !== "undefined") {
147
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
148
- const locale = m?.[1];
149
- if (locale !== void 0) return decodeURIComponent(locale);
150
- }
146
+ if (typeof document === "undefined") return null;
147
+ const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
148
+ const locale = m?.[1];
149
+ if (locale !== void 0) return decodeURIComponent(locale);
151
150
  if (typeof navigator !== "undefined" && navigator.language) {
152
151
  return navigator.language;
153
152
  }
@@ -279,7 +278,15 @@ function ensureStorageSync() {
279
278
  window.addEventListener(SESSION_SYNC_EVENT, () => notifySessionChanged());
280
279
  }
281
280
  __name(ensureStorageSync, "ensureStorageSync");
282
- var _sessionExpiredHandlers = /* @__PURE__ */ new Set();
281
+ var SESSION_EXPIRED_REGISTRY = `cfg-auth:expired-handlers:${ACCESS_KEY}`;
282
+ var _sessionExpiredHandlers = (() => {
283
+ const g = globalThis;
284
+ const existing = g[SESSION_EXPIRED_REGISTRY];
285
+ if (existing instanceof Set) return existing;
286
+ const created = /* @__PURE__ */ new Set();
287
+ g[SESSION_EXPIRED_REGISTRY] = created;
288
+ return created;
289
+ })();
283
290
  var _client = null;
284
291
  function pushClientConfig() {
285
292
  if (!_client) return;