@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/auth.cjs CHANGED
@@ -238,11 +238,10 @@ var _storageMode = "localStorage";
238
238
  var _storage = backendFor(_storageMode);
239
239
  function detectLocale() {
240
240
  try {
241
- if (typeof document !== "undefined") {
242
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
243
- const locale = m?.[1];
244
- if (locale !== void 0) return decodeURIComponent(locale);
245
- }
241
+ if (typeof document === "undefined") return null;
242
+ const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
243
+ const locale = m?.[1];
244
+ if (locale !== void 0) return decodeURIComponent(locale);
246
245
  if (typeof navigator !== "undefined" && navigator.language) {
247
246
  return navigator.language;
248
247
  }
@@ -374,7 +373,15 @@ function ensureStorageSync() {
374
373
  window.addEventListener(SESSION_SYNC_EVENT, () => notifySessionChanged());
375
374
  }
376
375
  __name(ensureStorageSync, "ensureStorageSync");
377
- var _sessionExpiredHandlers = /* @__PURE__ */ new Set();
376
+ var SESSION_EXPIRED_REGISTRY = `cfg-auth:expired-handlers:${ACCESS_KEY}`;
377
+ var _sessionExpiredHandlers = (() => {
378
+ const g = globalThis;
379
+ const existing = g[SESSION_EXPIRED_REGISTRY];
380
+ if (existing instanceof Set) return existing;
381
+ const created = /* @__PURE__ */ new Set();
382
+ g[SESSION_EXPIRED_REGISTRY] = created;
383
+ return created;
384
+ })();
378
385
  var _client = null;
379
386
  function pushClientConfig() {
380
387
  if (!_client) return;
@@ -3991,7 +3998,7 @@ var OAuthConnectionSchema = import_zod6.z.object({
3991
3998
  provider_display: import_zod6.z.string(),
3992
3999
  provider_username: import_zod6.z.string(),
3993
4000
  provider_email: import_zod6.z.email(),
3994
- provider_avatar_url: import_zod6.z.string(),
4001
+ provider_avatar_url: import_zod6.z.url(),
3995
4002
  connected_at: import_zod6.z.string().datetime({ offset: true }),
3996
4003
  last_login_at: import_zod6.z.string().datetime({ offset: true })
3997
4004
  });
@@ -4014,7 +4021,7 @@ var import_mutation5 = __toESM(require("swr/mutation"), 1);
4014
4021
  // src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeResponse.ts
4015
4022
  var import_zod9 = require("zod");
4016
4023
  var OAuthAuthorizeResponseSchema = import_zod9.z.object({
4017
- authorization_url: import_zod9.z.string(),
4024
+ authorization_url: import_zod9.z.url(),
4018
4025
  state: import_zod9.z.string()
4019
4026
  });
4020
4027
 
@@ -4077,7 +4084,7 @@ var WebmailLinkProviderEnumSchema = import_zod14.z.enum(["gmail", "outlook", "ya
4077
4084
  var WebmailLinkSchema = import_zod15.z.object({
4078
4085
  provider: WebmailLinkProviderEnumSchema,
4079
4086
  provider_name: import_zod15.z.string(),
4080
- url: import_zod15.z.string(),
4087
+ url: import_zod15.z.url(),
4081
4088
  is_search: import_zod15.z.boolean()
4082
4089
  });
4083
4090
 
@@ -4155,7 +4162,7 @@ var UserSchema = import_zod17.z.object({
4155
4162
  position: import_zod17.z.string().max(100).nullable().optional(),
4156
4163
  language: import_zod17.z.string().max(10).nullable().optional(),
4157
4164
  timezone: import_zod17.z.string().max(64).nullable().optional(),
4158
- avatar: import_zod17.z.string().nullable(),
4165
+ avatar: import_zod17.z.url().nullable(),
4159
4166
  is_staff: import_zod17.z.boolean(),
4160
4167
  is_superuser: import_zod17.z.boolean(),
4161
4168
  date_joined: import_zod17.z.string().datetime({ offset: true }),
@@ -4489,8 +4496,8 @@ var CfgUserUpdateRequestSchema = import_zod24.z.object({
4489
4496
  // src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeRequestRequest.ts
4490
4497
  var import_zod25 = require("zod");
4491
4498
  var OAuthAuthorizeRequestRequestSchema = import_zod25.z.object({
4492
- redirect_uri: import_zod25.z.string().optional(),
4493
- source_url: import_zod25.z.string().optional()
4499
+ redirect_uri: import_zod25.z.url().optional(),
4500
+ source_url: import_zod25.z.url().optional()
4494
4501
  });
4495
4502
 
4496
4503
  // src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts
@@ -4498,7 +4505,7 @@ var import_zod26 = require("zod");
4498
4505
  var OAuthCallbackRequestRequestSchema = import_zod26.z.object({
4499
4506
  code: import_zod26.z.string().min(10).max(500),
4500
4507
  state: import_zod26.z.string().min(20).max(100),
4501
- redirect_uri: import_zod26.z.string().optional(),
4508
+ redirect_uri: import_zod26.z.url().optional(),
4502
4509
  remember_me: import_zod26.z.boolean().default(false).optional()
4503
4510
  });
4504
4511
 
@@ -4527,7 +4534,7 @@ var OTPErrorResponseSchema = import_zod29.z.object({
4527
4534
  var import_zod30 = require("zod");
4528
4535
  var OTPRequestRequestSchema = import_zod30.z.object({
4529
4536
  identifier: import_zod30.z.string().min(1),
4530
- source_url: import_zod30.z.string().optional(),
4537
+ source_url: import_zod30.z.url().optional(),
4531
4538
  marketing_consent: import_zod30.z.boolean().nullable().optional(),
4532
4539
  consent_disclosure_version: import_zod30.z.string().max(64).optional()
4533
4540
  });
@@ -4537,7 +4544,7 @@ var import_zod31 = require("zod");
4537
4544
  var OTPVerifyRequestSchema = import_zod31.z.object({
4538
4545
  identifier: import_zod31.z.string().min(1),
4539
4546
  otp: import_zod31.z.string().min(4).max(4),
4540
- source_url: import_zod31.z.string().optional(),
4547
+ source_url: import_zod31.z.url().optional(),
4541
4548
  remember_me: import_zod31.z.boolean().default(false).optional()
4542
4549
  });
4543
4550