@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/auth.mjs CHANGED
@@ -166,11 +166,10 @@ var _storageMode = "localStorage";
166
166
  var _storage = backendFor(_storageMode);
167
167
  function detectLocale() {
168
168
  try {
169
- if (typeof document !== "undefined") {
170
- const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
171
- const locale = m?.[1];
172
- if (locale !== void 0) return decodeURIComponent(locale);
173
- }
169
+ if (typeof document === "undefined") return null;
170
+ const m = document.cookie.match(/(?:^|;\s*)NEXT_LOCALE=([^;]*)/);
171
+ const locale = m?.[1];
172
+ if (locale !== void 0) return decodeURIComponent(locale);
174
173
  if (typeof navigator !== "undefined" && navigator.language) {
175
174
  return navigator.language;
176
175
  }
@@ -302,7 +301,15 @@ function ensureStorageSync() {
302
301
  window.addEventListener(SESSION_SYNC_EVENT, () => notifySessionChanged());
303
302
  }
304
303
  __name(ensureStorageSync, "ensureStorageSync");
305
- var _sessionExpiredHandlers = /* @__PURE__ */ new Set();
304
+ var SESSION_EXPIRED_REGISTRY = `cfg-auth:expired-handlers:${ACCESS_KEY}`;
305
+ var _sessionExpiredHandlers = (() => {
306
+ const g = globalThis;
307
+ const existing = g[SESSION_EXPIRED_REGISTRY];
308
+ if (existing instanceof Set) return existing;
309
+ const created = /* @__PURE__ */ new Set();
310
+ g[SESSION_EXPIRED_REGISTRY] = created;
311
+ return created;
312
+ })();
306
313
  var _client = null;
307
314
  function pushClientConfig() {
308
315
  if (!_client) return;
@@ -3927,7 +3934,7 @@ var OAuthConnectionSchema = z6.object({
3927
3934
  provider_display: z6.string(),
3928
3935
  provider_username: z6.string(),
3929
3936
  provider_email: z6.email(),
3930
- provider_avatar_url: z6.string(),
3937
+ provider_avatar_url: z6.url(),
3931
3938
  connected_at: z6.string().datetime({ offset: true }),
3932
3939
  last_login_at: z6.string().datetime({ offset: true })
3933
3940
  });
@@ -3950,7 +3957,7 @@ import useSWRMutation5 from "swr/mutation";
3950
3957
  // src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeResponse.ts
3951
3958
  import { z as z9 } from "zod";
3952
3959
  var OAuthAuthorizeResponseSchema = z9.object({
3953
- authorization_url: z9.string(),
3960
+ authorization_url: z9.url(),
3954
3961
  state: z9.string()
3955
3962
  });
3956
3963
 
@@ -4013,7 +4020,7 @@ var WebmailLinkProviderEnumSchema = z14.enum(["gmail", "outlook", "yahoo", "iclo
4013
4020
  var WebmailLinkSchema = z15.object({
4014
4021
  provider: WebmailLinkProviderEnumSchema,
4015
4022
  provider_name: z15.string(),
4016
- url: z15.string(),
4023
+ url: z15.url(),
4017
4024
  is_search: z15.boolean()
4018
4025
  });
4019
4026
 
@@ -4091,7 +4098,7 @@ var UserSchema = z17.object({
4091
4098
  position: z17.string().max(100).nullable().optional(),
4092
4099
  language: z17.string().max(10).nullable().optional(),
4093
4100
  timezone: z17.string().max(64).nullable().optional(),
4094
- avatar: z17.string().nullable(),
4101
+ avatar: z17.url().nullable(),
4095
4102
  is_staff: z17.boolean(),
4096
4103
  is_superuser: z17.boolean(),
4097
4104
  date_joined: z17.string().datetime({ offset: true }),
@@ -4425,8 +4432,8 @@ var CfgUserUpdateRequestSchema = z24.object({
4425
4432
  // src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeRequestRequest.ts
4426
4433
  import { z as z25 } from "zod";
4427
4434
  var OAuthAuthorizeRequestRequestSchema = z25.object({
4428
- redirect_uri: z25.string().optional(),
4429
- source_url: z25.string().optional()
4435
+ redirect_uri: z25.url().optional(),
4436
+ source_url: z25.url().optional()
4430
4437
  });
4431
4438
 
4432
4439
  // src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts
@@ -4434,7 +4441,7 @@ import { z as z26 } from "zod";
4434
4441
  var OAuthCallbackRequestRequestSchema = z26.object({
4435
4442
  code: z26.string().min(10).max(500),
4436
4443
  state: z26.string().min(20).max(100),
4437
- redirect_uri: z26.string().optional(),
4444
+ redirect_uri: z26.url().optional(),
4438
4445
  remember_me: z26.boolean().default(false).optional()
4439
4446
  });
4440
4447
 
@@ -4463,7 +4470,7 @@ var OTPErrorResponseSchema = z29.object({
4463
4470
  import { z as z30 } from "zod";
4464
4471
  var OTPRequestRequestSchema = z30.object({
4465
4472
  identifier: z30.string().min(1),
4466
- source_url: z30.string().optional(),
4473
+ source_url: z30.url().optional(),
4467
4474
  marketing_consent: z30.boolean().nullable().optional(),
4468
4475
  consent_disclosure_version: z30.string().max(64).optional()
4469
4476
  });
@@ -4473,7 +4480,7 @@ import { z as z31 } from "zod";
4473
4480
  var OTPVerifyRequestSchema = z31.object({
4474
4481
  identifier: z31.string().min(1),
4475
4482
  otp: z31.string().min(4).max(4),
4476
- source_url: z31.string().optional(),
4483
+ source_url: z31.url().optional(),
4477
4484
  remember_me: z31.boolean().default(false).optional()
4478
4485
  });
4479
4486