authhero 0.298.0 → 0.299.0

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/authhero.mjs CHANGED
@@ -354,13 +354,13 @@ class Bs extends Na {
354
354
  } : c;
355
355
  const _ = this.resolve(e, i);
356
356
  let w = _?.res;
357
- const x = _?.usedKey || c, E = _?.exactUsedKey || c, I = ["[object Number]", "[object Function]", "[object RegExp]"], O = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, A = !this.i18nFormat || this.i18nFormat.handleAsObject, N = i.count !== void 0 && !ee(i.count), T = Bs.hasDefaultValue(i), J = N ? this.pluralResolver.getSuffix(f, i.count, i) : "", Q = i.ordinal && N ? this.pluralResolver.getSuffix(f, i.count, {
357
+ const x = _?.usedKey || c, E = _?.exactUsedKey || c, O = ["[object Number]", "[object Function]", "[object RegExp]"], I = i.joinArrays !== void 0 ? i.joinArrays : this.options.joinArrays, A = !this.i18nFormat || this.i18nFormat.handleAsObject, N = i.count !== void 0 && !ee(i.count), T = Bs.hasDefaultValue(i), J = N ? this.pluralResolver.getSuffix(f, i.count, i) : "", Q = i.ordinal && N ? this.pluralResolver.getSuffix(f, i.count, {
358
358
  ordinal: !1
359
359
  }) : "", X = N && !i.ordinal && i.count === 0, q = X && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${J}`] || i[`defaultValue${Q}`] || i.defaultValue;
360
360
  let de = w;
361
361
  A && !w && T && (de = q);
362
362
  const ue = Vc(de), ge = Object.prototype.toString.apply(de);
363
- if (A && de && ue && I.indexOf(ge) < 0 && !(ee(O) && Array.isArray(de))) {
363
+ if (A && de && ue && O.indexOf(ge) < 0 && !(ee(I) && Array.isArray(de))) {
364
364
  if (!i.returnObjects && !this.options.returnObjects) {
365
365
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
366
366
  const xe = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(x, de, {
@@ -387,8 +387,8 @@ class Bs extends Na {
387
387
  }
388
388
  w = ve;
389
389
  }
390
- } else if (A && ee(O) && Array.isArray(w))
391
- w = w.join(O), w && (w = this.extendTranslation(w, e, i, r));
390
+ } else if (A && ee(I) && Array.isArray(w))
391
+ w = w.join(I), w && (w = this.extendTranslation(w, e, i, r));
392
392
  else {
393
393
  let xe = !1, ve = !1;
394
394
  !this.isValidLookup(w) && T && (xe = !0, w = q), this.isValidLookup(w) || (ve = !0, w = c);
@@ -473,24 +473,24 @@ class Bs extends Na {
473
473
  this.options.fallbackNS && (f = f.concat(this.options.fallbackNS));
474
474
  const g = n.count !== void 0 && !ee(n.count), _ = g && !n.ordinal && n.count === 0, w = n.context !== void 0 && (ee(n.context) || typeof n.context == "number") && n.context !== "", x = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng);
475
475
  f.forEach((E) => {
476
- this.isValidLookup(r) || (c = E, !af[`${x[0]}-${E}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(c) && (af[`${x[0]}-${E}`] = !0, this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), x.forEach((I) => {
476
+ this.isValidLookup(r) || (c = E, !af[`${x[0]}-${E}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(c) && (af[`${x[0]}-${E}`] = !0, this.logger.warn(`key "${i}" for languages "${x.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), x.forEach((O) => {
477
477
  if (this.isValidLookup(r)) return;
478
- a = I;
479
- const O = [u];
478
+ a = O;
479
+ const I = [u];
480
480
  if (this.i18nFormat?.addLookupKeys)
481
- this.i18nFormat.addLookupKeys(O, u, I, E, n);
481
+ this.i18nFormat.addLookupKeys(I, u, O, E, n);
482
482
  else {
483
483
  let N;
484
- g && (N = this.pluralResolver.getSuffix(I, n.count, n));
484
+ g && (N = this.pluralResolver.getSuffix(O, n.count, n));
485
485
  const T = `${this.options.pluralSeparator}zero`, J = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
486
- if (g && (n.ordinal && N.indexOf(J) === 0 && O.push(u + N.replace(J, this.options.pluralSeparator)), O.push(u + N), _ && O.push(u + T)), w) {
486
+ if (g && (n.ordinal && N.indexOf(J) === 0 && I.push(u + N.replace(J, this.options.pluralSeparator)), I.push(u + N), _ && I.push(u + T)), w) {
487
487
  const Q = `${u}${this.options.contextSeparator || "_"}${n.context}`;
488
- O.push(Q), g && (n.ordinal && N.indexOf(J) === 0 && O.push(Q + N.replace(J, this.options.pluralSeparator)), O.push(Q + N), _ && O.push(Q + T));
488
+ I.push(Q), g && (n.ordinal && N.indexOf(J) === 0 && I.push(Q + N.replace(J, this.options.pluralSeparator)), I.push(Q + N), _ && I.push(Q + T));
489
489
  }
490
490
  }
491
491
  let A;
492
- for (; A = O.pop(); )
493
- this.isValidLookup(r) || (s = A, r = this.getResource(I, E, A, n));
492
+ for (; A = I.pop(); )
493
+ this.isValidLookup(r) || (s = A, r = this.getResource(O, E, A, n));
494
494
  }));
495
495
  });
496
496
  }), {
@@ -682,10 +682,10 @@ class pf {
682
682
  nestingSuffix: w,
683
683
  nestingSuffixEscaped: x,
684
684
  nestingOptionsSeparator: E,
685
- maxReplaces: I,
686
- alwaysFormat: O
685
+ maxReplaces: O,
686
+ alwaysFormat: I
687
687
  } = e.interpolation;
688
- this.escape = n !== void 0 ? n : I1, this.escapeValue = r !== void 0 ? r : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? xr(s) : a || "{{", this.suffix = c ? xr(c) : l || "}}", this.formatSeparator = d || ",", this.unescapePrefix = u ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = g ? xr(g) : _ || xr("$t("), this.nestingSuffix = w ? xr(w) : x || xr(")"), this.nestingOptionsSeparator = E || ",", this.maxReplaces = I || 1e3, this.alwaysFormat = O !== void 0 ? O : !1, this.resetRegExp();
688
+ this.escape = n !== void 0 ? n : I1, this.escapeValue = r !== void 0 ? r : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = s ? xr(s) : a || "{{", this.suffix = c ? xr(c) : l || "}}", this.formatSeparator = d || ",", this.unescapePrefix = u ? "" : f || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = g ? xr(g) : _ || xr("$t("), this.nestingSuffix = w ? xr(w) : x || xr(")"), this.nestingOptionsSeparator = E || ",", this.maxReplaces = O || 1e3, this.alwaysFormat = I !== void 0 ? I : !1, this.resetRegExp();
689
689
  }
690
690
  reset() {
691
691
  this.options && this.init(this.options);
@@ -698,12 +698,12 @@ class pf {
698
698
  let s, a, c;
699
699
  const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, d = (_) => {
700
700
  if (_.indexOf(this.formatSeparator) < 0) {
701
- const I = uf(n, l, _, this.options.keySeparator, this.options.ignoreJSONStructure);
702
- return this.alwaysFormat ? this.format(I, void 0, r, {
701
+ const O = uf(n, l, _, this.options.keySeparator, this.options.ignoreJSONStructure);
702
+ return this.alwaysFormat ? this.format(O, void 0, r, {
703
703
  ...i,
704
704
  ...n,
705
705
  interpolationkey: _
706
- }) : I;
706
+ }) : O;
707
707
  }
708
708
  const w = _.split(this.formatSeparator), x = w.shift().trim(), E = w.join(this.formatSeparator).trim();
709
709
  return this.format(uf(n, l, x, this.options.keySeparator, this.options.ignoreJSONStructure), E, r, {
@@ -6676,13 +6676,13 @@ async function _v(t, e) {
6676
6676
  );
6677
6677
  if (f === "access_token_authz")
6678
6678
  return { scopes: a, permissions: E };
6679
- let I;
6680
- return s.length === 0 ? I = w.filter(
6679
+ let O;
6680
+ return s.length === 0 ? O = w.filter(
6681
6681
  (A) => x.includes(A)
6682
- ) : I = s.filter(
6682
+ ) : O = s.filter(
6683
6683
  (A) => x.includes(A) && w.includes(A)
6684
6684
  ), { scopes: [
6685
- .../* @__PURE__ */ new Set([...a, ...I])
6685
+ .../* @__PURE__ */ new Set([...a, ...O])
6686
6686
  ], permissions: E };
6687
6687
  }
6688
6688
  async function zs(t, e) {
@@ -6736,18 +6736,18 @@ async function zs(t, e) {
6736
6736
  r,
6737
6737
  void 0,
6738
6738
  a
6739
- ) : [], I = [...x, ...E], O = [];
6740
- for (const q of I)
6739
+ ) : [], O = [...x, ...E], I = [];
6740
+ for (const q of O)
6741
6741
  (await t.env.data.rolePermissions.list(
6742
6742
  n,
6743
6743
  q.id
6744
6744
  )).forEach((ue) => {
6745
- ue.resource_server_identifier === i && O.push(ue.permission_name);
6745
+ ue.resource_server_identifier === i && I.push(ue.permission_name);
6746
6746
  });
6747
6747
  const A = /* @__PURE__ */ new Set();
6748
6748
  w.forEach((q) => {
6749
6749
  q.resource_server_identifier === i && A.add(q.permission_name);
6750
- }), O.forEach((q) => {
6750
+ }), I.forEach((q) => {
6751
6751
  A.add(q);
6752
6752
  });
6753
6753
  const N = Array.from(A), T = N.filter(
@@ -6866,19 +6866,19 @@ async function Ta(t, e) {
6866
6866
  }
6867
6867
  }
6868
6868
  );
6869
- const I = {
6869
+ const O = {
6870
6870
  expiresIn: l ? new Ds(1, "h") : new Ds(1, "d"),
6871
6871
  headers: {
6872
6872
  kid: f.kid
6873
6873
  }
6874
- }, O = await Af(
6874
+ }, I = await Af(
6875
6875
  "RS256",
6876
6876
  g,
6877
6877
  x,
6878
- I
6879
- ), A = E ? await Af("RS256", g, E, I) : void 0;
6878
+ O
6879
+ ), A = E ? await Af("RS256", g, E, O) : void 0;
6880
6880
  return {
6881
- access_token: O,
6881
+ access_token: I,
6882
6882
  refresh_token: e.refresh_token,
6883
6883
  id_token: A,
6884
6884
  token_type: "Bearer",
@@ -10367,7 +10367,7 @@ const Yf = st.extend({
10367
10367
  x
10368
10368
  );
10369
10369
  if (d) {
10370
- const O = {
10370
+ const I = {
10371
10371
  user_id: w,
10372
10372
  // Use the original user_id, not result.user_id
10373
10373
  password: await On.hash(d, 10),
@@ -10376,14 +10376,14 @@ const Yf = st.extend({
10376
10376
  };
10377
10377
  await t.env.data.passwords.create(
10378
10378
  t.var.tenant_id,
10379
- O
10379
+ I
10380
10380
  );
10381
10381
  }
10382
10382
  t.set("user_id", E.user_id), await se(t, t.var.tenant_id, {
10383
10383
  type: oe.SUCCESS_API_OPERATION,
10384
10384
  description: "User created"
10385
10385
  });
10386
- const I = E.identities ? E : {
10386
+ const O = E.identities ? E : {
10387
10387
  ...E,
10388
10388
  identities: [
10389
10389
  {
@@ -10394,7 +10394,7 @@ const Yf = st.extend({
10394
10394
  }
10395
10395
  ]
10396
10396
  };
10397
- return t.json(en.parse(I), {
10397
+ return t.json(en.parse(O), {
10398
10398
  status: 201
10399
10399
  });
10400
10400
  } catch (x) {
@@ -11108,7 +11108,7 @@ function g3() {
11108
11108
  } : function($, S) {
11109
11109
  return $[S];
11110
11110
  }
11111
- }, g = Object.getPrototypeOf(Function), _ = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : v1(), w = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : $1(), x = typeof WeakMap == "function" ? WeakMap : k1(), E = s ? /* @__PURE__ */ Symbol.for("@reflect-metadata:registry") : void 0, I = y1(), O = w1(I);
11111
+ }, g = Object.getPrototypeOf(Function), _ = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : v1(), w = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : $1(), x = typeof WeakMap == "function" ? WeakMap : k1(), E = s ? /* @__PURE__ */ Symbol.for("@reflect-metadata:registry") : void 0, O = y1(), I = w1(O);
11112
11112
  function A($, S, C, L) {
11113
11113
  if (W(C)) {
11114
11114
  if (!Gp($))
@@ -11526,7 +11526,7 @@ function g3() {
11526
11526
  OrdinaryOwnMetadataKeys: ae,
11527
11527
  OrdinaryDeleteMetadata: D
11528
11528
  };
11529
- return I.registerProvider(C), C;
11529
+ return O.registerProvider(C), C;
11530
11530
  function L(F, V, K) {
11531
11531
  var ce = S.get(F), _e = !1;
11532
11532
  if (W(ce)) {
@@ -11628,12 +11628,12 @@ function g3() {
11628
11628
  return ae;
11629
11629
  }
11630
11630
  function Ai($, S, C) {
11631
- var L = I.getProvider($, S);
11631
+ var L = O.getProvider($, S);
11632
11632
  if (!W(L))
11633
11633
  return L;
11634
11634
  if (C) {
11635
- if (I.setProvider($, S, O))
11636
- return O;
11635
+ if (O.setProvider($, S, I))
11636
+ return I;
11637
11637
  throw new Error("Illegal state.");
11638
11638
  }
11639
11639
  }
@@ -21789,7 +21789,7 @@ var ik = async (t, e, n) => {
21789
21789
  if (!f.aud)
21790
21790
  throw new X$(f);
21791
21791
  if (!(Array.isArray(f.aud) ? f.aud : [f.aud]).some(
21792
- (I) => l instanceof RegExp ? l.test(I) : typeof l == "string" ? I === l : Array.isArray(l) && l.includes(I)
21792
+ (O) => l instanceof RegExp ? l.test(O) : typeof l == "string" ? O === l : Array.isArray(l) && l.includes(O)
21793
21793
  ))
21794
21794
  throw new Z$(l, f.aud);
21795
21795
  }
@@ -22506,20 +22506,20 @@ function Rc(t, e) {
22506
22506
  if (_ == null)
22507
22507
  continue;
22508
22508
  const w = d || u.has(g), x = {};
22509
- for (const [E, I] of Object.entries(
22509
+ for (const [E, O] of Object.entries(
22510
22510
  _
22511
22511
  ))
22512
- if (typeof I == "function") {
22512
+ if (typeof O == "function") {
22513
22513
  if (!w) {
22514
- x[E] = I;
22514
+ x[E] = O;
22515
22515
  continue;
22516
22516
  }
22517
- const O = `${g}:${E}`;
22518
- if (l.has(O)) {
22519
- x[E] = I;
22517
+ const I = `${g}:${E}`;
22518
+ if (l.has(I)) {
22519
+ x[E] = O;
22520
22520
  continue;
22521
22521
  }
22522
- const A = i[O] ?? r, N = [
22522
+ const A = i[I] ?? r, N = [
22523
22523
  "create",
22524
22524
  "update",
22525
22525
  "remove",
@@ -22529,7 +22529,7 @@ function Rc(t, e) {
22529
22529
  ].includes(E);
22530
22530
  x[E] = async (...T) => {
22531
22531
  if (N)
22532
- return await I.apply(_, T);
22532
+ return await O.apply(_, T);
22533
22533
  const J = _k(
22534
22534
  g,
22535
22535
  E,
@@ -22542,7 +22542,7 @@ function Rc(t, e) {
22542
22542
  return q.isCachedNull ? null : q.value;
22543
22543
  } else
22544
22544
  return Q;
22545
- const X = await I.apply(_, T);
22545
+ const X = await O.apply(_, T);
22546
22546
  if (A >= 0)
22547
22547
  if (X !== null)
22548
22548
  await n.set(J, X, A);
@@ -22556,7 +22556,7 @@ function Rc(t, e) {
22556
22556
  return X;
22557
22557
  };
22558
22558
  } else
22559
- x[E] = I;
22559
+ x[E] = O;
22560
22560
  f[g] = x;
22561
22561
  }
22562
22562
  return f;
@@ -24626,9 +24626,9 @@ const vk = st.extend({
24626
24626
  if (g) {
24627
24627
  const { sort_by: _, sort_order: w } = g;
24628
24628
  f.sort((x, E) => {
24629
- const I = x[_], O = E[_];
24630
- if (I === void 0 || O === void 0 || I === O) return 0;
24631
- const A = I < O ? -1 : 1;
24629
+ const O = x[_], I = E[_];
24630
+ if (O === void 0 || I === void 0 || O === I) return 0;
24631
+ const A = O < I ? -1 : 1;
24632
24632
  return w === "asc" ? A : -A;
24633
24633
  });
24634
24634
  }
@@ -26682,8 +26682,8 @@ var H5 = ";ext=", Cr = function(e) {
26682
26682
  return "([".concat(Ot, "]{1,").concat(e, "})");
26683
26683
  };
26684
26684
  function Dy(t) {
26685
- var e = "20", n = "15", r = "9", i = "6", s = "[  \\t,]*", a = "[:\\..]?[  \\t,-]*", c = "#?", l = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", u = "[- ]+", f = "[  \\t]*", g = "(?:,{2}|;)", _ = H5 + Cr(e), w = s + l + a + Cr(e) + c, x = s + d + a + Cr(r) + c, E = u + Cr(i) + "#", I = f + g + a + Cr(n) + c, O = f + "(?:,)+" + a + Cr(r) + c;
26686
- return _ + "|" + w + "|" + x + "|" + E + "|" + I + "|" + O;
26685
+ var e = "20", n = "15", r = "9", i = "6", s = "[  \\t,]*", a = "[:\\..]?[  \\t,-]*", c = "#?", l = "(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)", d = "(?:[xx##~~]|int|int)", u = "[- ]+", f = "[  \\t]*", g = "(?:,{2}|;)", _ = H5 + Cr(e), w = s + l + a + Cr(e) + c, x = s + d + a + Cr(r) + c, E = u + Cr(i) + "#", O = f + g + a + Cr(n) + c, I = f + "(?:,)+" + a + Cr(r) + c;
26686
+ return _ + "|" + w + "|" + x + "|" + E + "|" + O + "|" + I;
26687
26687
  }
26688
26688
  var V5 = "[" + Ot + "]{" + Op + "}", K5 = "[" + Pp + "]{0,1}(?:[" + Ea + "]*[" + Ot + "]){3,}[" + Ea + Ot + "]*", G5 = new RegExp("^[" + Pp + "]{0,1}(?:[" + Ea + "]*[" + Ot + "]){1,2}$", "i"), W5 = K5 + // Phone number extensions
26689
26689
  "(?:" + Dy() + ")?", J5 = new RegExp(
@@ -28548,7 +28548,7 @@ const $8 = new G().openapi(
28548
28548
  const N = A;
28549
28549
  "message" in N && typeof N.message == "string" && (_ = N.message);
28550
28550
  }
28551
- const w = t.get("ip"), x = t.get("useragent"), E = t.get("auth0_client"), I = pn(E), O = await e.data.loginSessions.create(
28551
+ const w = t.get("ip"), x = t.get("useragent"), E = t.get("auth0_client"), O = pn(E), I = await e.data.loginSessions.create(
28552
28552
  f.tenant.id,
28553
28553
  {
28554
28554
  authParams: {
@@ -28559,11 +28559,11 @@ const $8 = new G().openapi(
28559
28559
  csrf_token: he(),
28560
28560
  ip: w,
28561
28561
  useragent: x,
28562
- auth0Client: I
28562
+ auth0Client: O
28563
28563
  }
28564
28564
  );
28565
28565
  return t.redirect(
28566
- `${qe(t.env)}invalid-session?state=${O.id}&error=${encodeURIComponent(_)}`,
28566
+ `${qe(t.env)}invalid-session?state=${I.id}&error=${encodeURIComponent(_)}`,
28567
28567
  302
28568
28568
  );
28569
28569
  }
@@ -28978,11 +28978,11 @@ async function j8({
28978
28978
  if (!n || n?.expires_at && new Date(n.expires_at) < /* @__PURE__ */ new Date() || n?.idle_expires_at && new Date(n.idle_expires_at) < /* @__PURE__ */ new Date())
28979
28979
  return x();
28980
28980
  t.set("user_id", n.user_id);
28981
- const I = await g.data.users.get(e.tenant.id, n.user_id);
28982
- if (!I)
28981
+ const O = await g.data.users.get(e.tenant.id, n.user_id);
28982
+ if (!O)
28983
28983
  return console.error("User not found", n.user_id), x("User not found");
28984
- t.set("username", I.email), t.set("connection", I.connection);
28985
- const O = await g.data.loginSessions.create(e.tenant.id, {
28984
+ t.set("username", O.email), t.set("connection", O.connection);
28985
+ const I = await g.data.loginSessions.create(e.tenant.id, {
28986
28986
  csrf_token: he(),
28987
28987
  authParams: {
28988
28988
  client_id: e.client_id,
@@ -29012,18 +29012,18 @@ async function j8({
29012
29012
  response_type: u,
29013
29013
  redirect_uri: r
29014
29014
  },
29015
- user: I,
29015
+ user: O,
29016
29016
  session_id: n.id
29017
29017
  }, N = u === Et.CODE ? await hm(t, {
29018
- user: I,
29018
+ user: O,
29019
29019
  client: e,
29020
29020
  authParams: A.authParams,
29021
- login_id: O.id
29021
+ login_id: I.id
29022
29022
  }) : await Ta(t, A);
29023
29023
  await g.data.sessions.update(e.tenant.id, n.id, {
29024
29024
  used_at: (/* @__PURE__ */ new Date()).toISOString(),
29025
29025
  last_interaction_at: (/* @__PURE__ */ new Date()).toISOString(),
29026
- login_session_id: O.id,
29026
+ login_session_id: I.id,
29027
29027
  device: {
29028
29028
  ...n.device,
29029
29029
  last_ip: t.var.ip || "",
@@ -29141,8 +29141,8 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29141
29141
  prompt: w,
29142
29142
  login_ticket: x,
29143
29143
  realm: E,
29144
- auth0Client: I,
29145
- login_hint: O,
29144
+ auth0Client: O,
29145
+ login_hint: I,
29146
29146
  ui_locales: A,
29147
29147
  organization: N
29148
29148
  } = t.req.valid("query");
@@ -29163,7 +29163,7 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29163
29163
  response_mode: f,
29164
29164
  code_challenge: g,
29165
29165
  code_challenge_method: _,
29166
- username: O,
29166
+ username: I,
29167
29167
  ui_locales: A,
29168
29168
  organization: N
29169
29169
  }, Q = t.req.header("origin");
@@ -29230,7 +29230,7 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29230
29230
  authParams: J,
29231
29231
  session: de || void 0,
29232
29232
  connection: d,
29233
- login_hint: O
29233
+ login_hint: I
29234
29234
  });
29235
29235
  return ue instanceof Response ? ue : t.json(ue);
29236
29236
  }
@@ -29286,8 +29286,8 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29286
29286
  message: `Origin ${l} not allowed`
29287
29287
  });
29288
29288
  if (c.redirect_uri) {
29289
- const O = a.callbacks || [];
29290
- if (t.var.host && (O.push(`${Ma(t.env)}/*`), O.push(`${qe(t.env)}/*`)), !Cp(c.redirect_uri, O, {
29289
+ const I = a.callbacks || [];
29290
+ if (t.var.host && (I.push(`${Ma(t.env)}/*`), I.push(`${qe(t.env)}/*`)), !Cp(c.redirect_uri, I, {
29291
29291
  allowPathWildcards: !0,
29292
29292
  allowSubDomainWildcards: !0
29293
29293
  }))
@@ -29300,7 +29300,7 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29300
29300
  t.req.header("cookie")
29301
29301
  ), u = d ? await e.data.sessions.get(a.tenant.id, d) : void 0, f = u && !u.revoked_at ? u : void 0, g = new URL(t.req.url);
29302
29302
  t.var.custom_domain && (g.hostname = t.var.custom_domain);
29303
- const { ip: _, auth0_client: w, useragent: x } = t.var, E = pn(w), I = await e.data.loginSessions.create(
29303
+ const { ip: _, auth0_client: w, useragent: x } = t.var, E = pn(w), O = await e.data.loginSessions.create(
29304
29304
  a.tenant.id,
29305
29305
  {
29306
29306
  expires_at: new Date(
@@ -29320,22 +29320,22 @@ const I8 = ["email", "sms", "Username-Password-Authentication"], O8 = new G().op
29320
29320
  f.user_id
29321
29321
  ))?.email !== i)
29322
29322
  return t.redirect(
29323
- `${qe(t.env)}login/identifier?state=${encodeURIComponent(I.id)}`
29323
+ `${qe(t.env)}login/identifier?state=${encodeURIComponent(O.id)}`
29324
29324
  );
29325
- if (await e.data.loginSessions.update(a.tenant.id, I.id, {
29325
+ if (await e.data.loginSessions.update(a.tenant.id, O.id, {
29326
29326
  session_id: f.id
29327
29327
  }), s === "change-email") {
29328
29328
  const A = new URL(
29329
29329
  "/u/account/change-email",
29330
29330
  t.req.url
29331
29331
  );
29332
- return A.searchParams.set("state", I.id), t.redirect(A.toString());
29332
+ return A.searchParams.set("state", O.id), t.redirect(A.toString());
29333
29333
  }
29334
- const O = new URL("/u/account", t.req.url);
29335
- return O.searchParams.set("state", I.id), t.redirect(O.toString());
29334
+ const I = new URL("/u/account", t.req.url);
29335
+ return I.searchParams.set("state", O.id), t.redirect(I.toString());
29336
29336
  }
29337
29337
  return t.redirect(
29338
- `${qe(t.env)}login/identifier?state=${encodeURIComponent(I.id)}`
29338
+ `${qe(t.env)}login/identifier?state=${encodeURIComponent(O.id)}`
29339
29339
  );
29340
29340
  }
29341
29341
  );
@@ -29691,7 +29691,7 @@ const te = /* @__PURE__ */ h3(L8), wn = ({
29691
29691
  }).filter((re) => re !== null).filter((re) => !(c && re.disableEmbeddedBrowsers)), w = u || f, x = u && f ? "email_or_phone_placeholder" : u ? "email_placeholder" : f ? "phone_placeholder" : null, E = x ? y.t(
29692
29692
  x,
29693
29693
  u && f ? "Email or Phone Number" : u ? "Email Address" : "Phone Number"
29694
- ) : "", I = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", O = e?.colors?.primary_button_label || "#ffffff", A = e?.colors?.body_text || "#333333", N = e?.colors?.input_background || "#ffffff", T = e?.colors?.input_border || "#d1d5db", J = e?.colors?.input_filled_text || "#111827", Q = e?.colors?.error || "#dc2626", X = e?.colors?.widget_background || "#ffffff", q = e?.colors?.widget_border || "#e5e7eb", de = e?.borders?.widget_corner_radius || 8, ue = e?.borders?.input_border_radius || 4, ge = e?.borders?.button_border_radius || 4, xe = e?.borders?.show_widget_shadow ?? !0, ve = e?.fonts?.title?.size || 24, Qt = e?.fonts?.title?.bold ?? !0, Ue = e?.fonts?.body_text?.size || 14, tt = {
29694
+ ) : "", O = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", I = e?.colors?.primary_button_label || "#ffffff", A = e?.colors?.body_text || "#333333", N = e?.colors?.input_background || "#ffffff", T = e?.colors?.input_border || "#d1d5db", J = e?.colors?.input_filled_text || "#111827", Q = e?.colors?.error || "#dc2626", X = e?.colors?.widget_background || "#ffffff", q = e?.colors?.widget_border || "#e5e7eb", de = e?.borders?.widget_corner_radius || 8, ue = e?.borders?.input_border_radius || 4, ge = e?.borders?.button_border_radius || 4, xe = e?.borders?.show_widget_shadow ?? !0, ve = e?.fonts?.title?.size || 24, Qt = e?.fonts?.title?.bold ?? !0, Ue = e?.fonts?.body_text?.size || 14, tt = {
29695
29695
  backgroundColor: X,
29696
29696
  borderColor: q,
29697
29697
  borderRadius: `${de}px`,
@@ -29710,8 +29710,8 @@ const te = /* @__PURE__ */ h3(L8), wn = ({
29710
29710
  borderRadius: `${ue}px`,
29711
29711
  color: J
29712
29712
  }, Be = {
29713
- backgroundColor: I,
29714
- color: O,
29713
+ backgroundColor: O,
29714
+ color: I,
29715
29715
  borderRadius: `${ge}px`
29716
29716
  }, nt = e?.widget?.logo_position || "center", W = nt === "left" ? "text-left" : nt === "right" ? "text-right" : "text-center", wt = e?.widget?.logo_url || n?.logo_url, zc = nt !== "none" && wt;
29717
29717
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", a), children: [
@@ -30092,7 +30092,7 @@ const te = /* @__PURE__ */ h3(L8), wn = ({
30092
30092
  }).filter((A) => A !== null).filter((A) => !(a && A.disableEmbeddedBrowsers)), _ = d || u;
30093
30093
  let w = "text", x = "username";
30094
30094
  const E = d && u ? "email_or_phone_placeholder" : d ? "email_placeholder" : "phone_placeholder";
30095
- let I = y.t(
30095
+ let O = y.t(
30096
30096
  E,
30097
30097
  d && u ? "Email or Phone Number" : d ? "Email Address" : "Phone Number"
30098
30098
  );
@@ -30152,7 +30152,7 @@ const te = /* @__PURE__ */ h3(L8), wn = ({
30152
30152
  {
30153
30153
  type: w,
30154
30154
  name: x,
30155
- placeholder: I,
30155
+ placeholder: O,
30156
30156
  className: te(
30157
30157
  "mb-2 w-full rounded-lg border bg-gray-100 px-4 py-5 text-base lowercase placeholder:normal-case placeholder:text-gray-300 dark:bg-gray-600 md:text-base",
30158
30158
  {
@@ -30957,8 +30957,8 @@ e.match(/^(?:o|pai|str|u|ve)/)) ? e.replace(/([A-Z])/g, "-$1").toLowerCase() : e
30957
30957
  const _ = Ss[t];
30958
30958
  let w;
30959
30959
  if (_.length > 0) {
30960
- const O = s.querySelectorAll(t);
30961
- e: for (const A of O)
30960
+ const I = s.querySelectorAll(t);
30961
+ e: for (const A of I)
30962
30962
  for (const N of Ss[t])
30963
30963
  if (A.getAttribute(N) === e[N]) {
30964
30964
  f = A;
@@ -30980,53 +30980,53 @@ e.match(/^(?:o|pai|str|u|ve)/)) ? e.replace(/([A-Z])/g, "-$1").toLowerCase() : e
30980
30980
  w = s.querySelectorAll(t);
30981
30981
  l = r ? l ?? "" : void 0, r && (u[As] = l);
30982
30982
  const x = qp(
30983
- (O) => {
30983
+ (I) => {
30984
30984
  if (_.length > 0) {
30985
30985
  let A = !1;
30986
30986
  for (const N of s.querySelectorAll(t)) {
30987
30987
  if (A && N.getAttribute(As) !== l) {
30988
- s.insertBefore(O, N);
30988
+ s.insertBefore(I, N);
30989
30989
  return;
30990
30990
  }
30991
30991
  N.getAttribute(As) === l && (A = !0);
30992
30992
  }
30993
- s.appendChild(O);
30993
+ s.appendChild(I);
30994
30994
  } else if (w) {
30995
30995
  let A = !1;
30996
30996
  for (const N of w)
30997
- if (N === O) {
30997
+ if (N === I) {
30998
30998
  A = !0;
30999
30999
  break;
31000
31000
  }
31001
31001
  A || s.insertBefore(
31002
- O,
31002
+ I,
31003
31003
  s.contains(w[0]) ? w[0] : s.querySelector(t)
31004
31004
  ), w = void 0;
31005
31005
  }
31006
31006
  },
31007
31007
  [l]
31008
- ), E = Fp(e.ref, (O) => {
31008
+ ), E = Fp(e.ref, (I) => {
31009
31009
  const A = _[0];
31010
- if (n === 2 && (O.innerHTML = ""), (g || w) && x(O), !c && !a)
31010
+ if (n === 2 && (I.innerHTML = ""), (g || w) && x(I), !c && !a)
31011
31011
  return;
31012
- let N = _0[O.getAttribute(A)] ||= new Promise(
31012
+ let N = _0[I.getAttribute(A)] ||= new Promise(
31013
31013
  (T, J) => {
31014
- O.addEventListener("load", T), O.addEventListener("error", J);
31014
+ I.addEventListener("load", T), I.addEventListener("error", J);
31015
31015
  }
31016
31016
  );
31017
31017
  a && (N = N.then(a)), c && (N = N.catch(c)), N.catch(() => {
31018
31018
  });
31019
31019
  });
31020
31020
  if (i && d === "render") {
31021
- const O = Ss[t][0];
31022
- if (e[O]) {
31023
- const A = e[O], N = _0[A] ||= new Promise((T, J) => {
31021
+ const I = Ss[t][0];
31022
+ if (e[I]) {
31023
+ const A = e[I], N = _0[A] ||= new Promise((T, J) => {
31024
31024
  x(f), f.addEventListener("load", T), f.addEventListener("error", J);
31025
31025
  });
31026
31026
  dx(N);
31027
31027
  }
31028
31028
  }
31029
- const I = {
31029
+ const O = {
31030
31030
  tag: t,
31031
31031
  type: t,
31032
31032
  props: {
@@ -31035,8 +31035,8 @@ e.match(/^(?:o|pai|str|u|ve)/)) ? e.replace(/([A-Z])/g, "-$1").toLowerCase() : e
31035
31035
  },
31036
31036
  ref: E
31037
31037
  };
31038
- return I.p = n, f && (I.e = f), ix(
31039
- I,
31038
+ return O.p = n, f && (O.e = f), ix(
31039
+ O,
31040
31040
  s
31041
31041
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
31042
31042
  );
@@ -31288,15 +31288,15 @@ const yr = (t) => {
31288
31288
  }) => {
31289
31289
  const c = new URLSearchParams({
31290
31290
  state: i
31291
- }), l = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", d = e?.colors?.primary_button_label || "#ffffff", u = e?.colors?.body_text || "#333333", f = e?.colors?.input_border || "#d1d5db", g = e?.colors?.widget_background || "#ffffff", _ = e?.colors?.widget_border || "#e5e7eb", w = e?.borders?.widget_corner_radius || 8, x = e?.borders?.button_border_radius || 4, E = e?.borders?.show_widget_shadow ?? !0, I = e?.fonts?.title?.size || 24, O = e?.fonts?.title?.bold ?? !0, A = e?.fonts?.body_text?.size || 14, N = {
31291
+ }), l = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", d = e?.colors?.primary_button_label || "#ffffff", u = e?.colors?.body_text || "#333333", f = e?.colors?.input_border || "#d1d5db", g = e?.colors?.widget_background || "#ffffff", _ = e?.colors?.widget_border || "#e5e7eb", w = e?.borders?.widget_corner_radius || 8, x = e?.borders?.button_border_radius || 4, E = e?.borders?.show_widget_shadow ?? !0, O = e?.fonts?.title?.size || 24, I = e?.fonts?.title?.bold ?? !0, A = e?.fonts?.body_text?.size || 14, N = {
31292
31292
  backgroundColor: g,
31293
31293
  borderColor: _,
31294
31294
  borderRadius: `${w}px`,
31295
31295
  boxShadow: E ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
31296
31296
  color: u
31297
31297
  }, T = {
31298
- fontSize: `${I}px`,
31299
- fontWeight: O ? "700" : "400",
31298
+ fontSize: `${O}px`,
31299
+ fontWeight: I ? "700" : "400",
31300
31300
  color: e?.colors?.header || u
31301
31301
  }, J = {
31302
31302
  fontSize: `${A}px`,
@@ -31819,11 +31819,11 @@ const yr = (t) => {
31819
31819
  email: i,
31820
31820
  className: s
31821
31821
  }) => {
31822
- const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, I = e?.borders?.button_border_radius || 4, O = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
31822
+ const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, O = e?.borders?.button_border_radius || 4, I = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
31823
31823
  backgroundColor: _,
31824
31824
  borderColor: w,
31825
31825
  borderRadius: `${x}px`,
31826
- boxShadow: O ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
31826
+ boxShadow: I ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
31827
31827
  color: l
31828
31828
  }, Q = {
31829
31829
  fontSize: `${A}px`,
@@ -31840,7 +31840,7 @@ const yr = (t) => {
31840
31840
  }, de = {
31841
31841
  backgroundColor: a,
31842
31842
  color: c,
31843
- borderRadius: `${I}px`
31843
+ borderRadius: `${O}px`
31844
31844
  }, ue = e?.widget?.logo_position || "center", ge = ue === "left" ? "text-left" : ue === "right" ? "text-right" : "text-center", xe = e?.widget?.logo_url || n?.logo_url, ve = ue !== "none" && xe;
31845
31845
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", s), children: /* @__PURE__ */ p(wn, { style: J, className: "border", children: [
31846
31846
  /* @__PURE__ */ p(bn, { children: [
@@ -32237,7 +32237,7 @@ const yr = (t) => {
32237
32237
  code: s,
32238
32238
  className: a
32239
32239
  }) => {
32240
- const c = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", l = e?.colors?.primary_button_label || "#ffffff", d = e?.colors?.body_text || "#333333", u = e?.colors?.input_background || "#ffffff", f = e?.colors?.input_border || "#d1d5db", g = e?.colors?.input_filled_text || "#111827", _ = e?.colors?.error || "#dc2626", w = e?.colors?.widget_background || "#ffffff", x = e?.colors?.widget_border || "#e5e7eb", E = e?.borders?.widget_corner_radius || 8, I = e?.borders?.input_border_radius || 4, O = e?.borders?.button_border_radius || 4, A = e?.borders?.show_widget_shadow ?? !0, N = e?.fonts?.title?.size || 24, T = e?.fonts?.title?.bold ?? !0, J = e?.fonts?.body_text?.size || 14, Q = {
32240
+ const c = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", l = e?.colors?.primary_button_label || "#ffffff", d = e?.colors?.body_text || "#333333", u = e?.colors?.input_background || "#ffffff", f = e?.colors?.input_border || "#d1d5db", g = e?.colors?.input_filled_text || "#111827", _ = e?.colors?.error || "#dc2626", w = e?.colors?.widget_background || "#ffffff", x = e?.colors?.widget_border || "#e5e7eb", E = e?.borders?.widget_corner_radius || 8, O = e?.borders?.input_border_radius || 4, I = e?.borders?.button_border_radius || 4, A = e?.borders?.show_widget_shadow ?? !0, N = e?.fonts?.title?.size || 24, T = e?.fonts?.title?.bold ?? !0, J = e?.fonts?.body_text?.size || 14, Q = {
32241
32241
  backgroundColor: w,
32242
32242
  borderColor: x,
32243
32243
  borderRadius: `${E}px`,
@@ -32253,12 +32253,12 @@ const yr = (t) => {
32253
32253
  }, de = {
32254
32254
  backgroundColor: u,
32255
32255
  borderColor: t ? _ : f,
32256
- borderRadius: `${I}px`,
32256
+ borderRadius: `${O}px`,
32257
32257
  color: g
32258
32258
  }, ue = {
32259
32259
  backgroundColor: c,
32260
32260
  color: l,
32261
- borderRadius: `${O}px`
32261
+ borderRadius: `${I}px`
32262
32262
  }, ge = e?.widget?.logo_position || "center", xe = ge === "left" ? "text-left" : ge === "right" ? "text-right" : "text-center", ve = e?.widget?.logo_url || n?.logo_url, Qt = ge !== "none" && ve;
32263
32263
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", a), children: /* @__PURE__ */ p(wn, { style: Q, className: "border", children: [
32264
32264
  /* @__PURE__ */ p(bn, { children: [
@@ -32740,7 +32740,7 @@ const yr = (t) => {
32740
32740
  ),
32741
32741
  400
32742
32742
  );
32743
- const x = _?.authParams.username === c.authParams.username, E = `auth2|${Oa()}`, I = await r.data.users.create(a.tenant.id, {
32743
+ const x = _?.authParams.username === c.authParams.username, E = `auth2|${Oa()}`, O = await r.data.users.create(a.tenant.id, {
32744
32744
  user_id: E,
32745
32745
  email: c.authParams.username,
32746
32746
  email_verified: x,
@@ -32755,7 +32755,7 @@ const yr = (t) => {
32755
32755
  is_current: !0
32756
32756
  }), !x) {
32757
32757
  const A = c.authParams?.ui_locales?.split(" ")?.map((N) => N.split("-")[0])[0];
32758
- return await zp(t, I, A), t.html(
32758
+ return await zp(t, O, A), t.html(
32759
32759
  /* @__PURE__ */ p(
32760
32760
  Pt,
32761
32761
  {
@@ -32769,7 +32769,7 @@ const yr = (t) => {
32769
32769
  )
32770
32770
  );
32771
32771
  }
32772
- const O = await Vy(
32772
+ const I = await Vy(
32773
32773
  t,
32774
32774
  a,
32775
32775
  {
@@ -32778,7 +32778,7 @@ const yr = (t) => {
32778
32778
  },
32779
32779
  c
32780
32780
  );
32781
- return Vt(t, O);
32781
+ return Vt(t, I);
32782
32782
  } catch (d) {
32783
32783
  let u = y.t("unknown_error_message"), f = 400;
32784
32784
  return d instanceof b ? (u = d.message || u, f = d.status === 400 ? 400 : 500) : d instanceof Tr ? u = d.message || u : d instanceof Error && (u = d.message || u, f = 500), l ? t.html(
@@ -32862,11 +32862,11 @@ const yr = (t) => {
32862
32862
  email: i,
32863
32863
  className: s
32864
32864
  }) => {
32865
- const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, I = e?.borders?.button_border_radius || 4, O = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
32865
+ const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, O = e?.borders?.button_border_radius || 4, I = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
32866
32866
  backgroundColor: _,
32867
32867
  borderColor: w,
32868
32868
  borderRadius: `${x}px`,
32869
- boxShadow: O ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
32869
+ boxShadow: I ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
32870
32870
  color: l
32871
32871
  }, Q = {
32872
32872
  fontSize: `${A}px`,
@@ -32883,7 +32883,7 @@ const yr = (t) => {
32883
32883
  }, de = {
32884
32884
  backgroundColor: a,
32885
32885
  color: c,
32886
- borderRadius: `${I}px`
32886
+ borderRadius: `${O}px`
32887
32887
  }, ue = e?.widget?.logo_position || "center", ge = ue === "left" ? "text-left" : ue === "right" ? "text-right" : "text-center", xe = e?.widget?.logo_url || n?.logo_url, ve = ue !== "none" && xe;
32888
32888
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", s), children: /* @__PURE__ */ p(wn, { style: J, className: "border", children: [
32889
32889
  /* @__PURE__ */ p(bn, { children: [
@@ -33427,11 +33427,11 @@ const yr = (t) => {
33427
33427
  email: i,
33428
33428
  className: s
33429
33429
  }) => {
33430
- const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, I = e?.borders?.button_border_radius || 4, O = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
33430
+ const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_background || "#ffffff", u = e?.colors?.input_border || "#d1d5db", f = e?.colors?.input_filled_text || "#111827", g = e?.colors?.error || "#dc2626", _ = e?.colors?.widget_background || "#ffffff", w = e?.colors?.widget_border || "#e5e7eb", x = e?.borders?.widget_corner_radius || 8, E = e?.borders?.input_border_radius || 4, O = e?.borders?.button_border_radius || 4, I = e?.borders?.show_widget_shadow ?? !0, A = e?.fonts?.title?.size || 24, N = e?.fonts?.title?.bold ?? !0, T = e?.fonts?.body_text?.size || 14, J = {
33431
33431
  backgroundColor: _,
33432
33432
  borderColor: w,
33433
33433
  borderRadius: `${x}px`,
33434
- boxShadow: O ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
33434
+ boxShadow: I ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
33435
33435
  color: l
33436
33436
  }, Q = {
33437
33437
  fontSize: `${A}px`,
@@ -33448,7 +33448,7 @@ const yr = (t) => {
33448
33448
  }, de = {
33449
33449
  backgroundColor: a,
33450
33450
  color: c,
33451
- borderRadius: `${I}px`
33451
+ borderRadius: `${O}px`
33452
33452
  }, ue = e?.widget?.logo_position || "center", ge = ue === "left" ? "text-left" : ue === "right" ? "text-right" : "text-center", xe = e?.widget?.logo_url || n?.logo_url, ve = ue !== "none" && xe;
33453
33453
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", s), children: /* @__PURE__ */ p(wn, { style: J, className: "border", children: [
33454
33454
  /* @__PURE__ */ p(bn, { children: [
@@ -33682,11 +33682,11 @@ const yr = (t) => {
33682
33682
  borderRadius: `${u}px`,
33683
33683
  boxShadow: g ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
33684
33684
  color: c
33685
- }, I = {
33685
+ }, O = {
33686
33686
  fontSize: `${_}px`,
33687
33687
  fontWeight: w ? "700" : "400",
33688
33688
  color: t?.colors?.header || c
33689
- }, O = {
33689
+ }, I = {
33690
33690
  fontSize: `${x}px`,
33691
33691
  color: t?.colors?.input_labels_placeholders || "#6b7280"
33692
33692
  }, A = {
@@ -33700,8 +33700,8 @@ const yr = (t) => {
33700
33700
  return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", i), children: /* @__PURE__ */ p(wn, { style: E, className: "border", children: [
33701
33701
  /* @__PURE__ */ p(bn, { children: [
33702
33702
  X && /* @__PURE__ */ p("div", { className: te("mb-4", J), children: /* @__PURE__ */ p(Zt, { theme: t, branding: e }) }),
33703
- /* @__PURE__ */ p(vn, { style: I, children: y.t("continue_with_account", "Continue with account") }),
33704
- /* @__PURE__ */ p($n, { style: O, children: [
33703
+ /* @__PURE__ */ p(vn, { style: O, children: y.t("continue_with_account", "Continue with account") }),
33704
+ /* @__PURE__ */ p($n, { style: I, children: [
33705
33705
  /* @__PURE__ */ p(
33706
33706
  yr,
33707
33707
  {
@@ -34904,11 +34904,11 @@ const yr = (t) => {
34904
34904
  borderRadius: `${u}px`,
34905
34905
  boxShadow: g ? "0 1px 3px 0 rgba(0, 0, 0, 0.1)" : "none",
34906
34906
  color: a
34907
- }, I = {
34907
+ }, O = {
34908
34908
  fontSize: `${_}px`,
34909
34909
  fontWeight: w ? "700" : "400",
34910
34910
  color: t?.colors?.header || a
34911
- }, O = {
34911
+ }, I = {
34912
34912
  fontSize: `${x}px`,
34913
34913
  color: t?.colors?.input_labels_placeholders || "#6b7280"
34914
34914
  }, A = {
@@ -34944,8 +34944,8 @@ const yr = (t) => {
34944
34944
  )
34945
34945
  }
34946
34946
  ) }),
34947
- /* @__PURE__ */ p(vn, { style: I, className: "text-center", children: y.t("email_validated", "Email Verified") }),
34948
- /* @__PURE__ */ p($n, { style: O, className: "text-center", children: y.t(
34947
+ /* @__PURE__ */ p(vn, { style: O, className: "text-center", children: y.t("email_validated", "Email Verified") }),
34948
+ /* @__PURE__ */ p($n, { style: I, className: "text-center", children: y.t(
34949
34949
  "email_validated_description",
34950
34950
  "Your email has been successfully verified. You can now continue to login."
34951
34951
  ) })
@@ -35345,17 +35345,17 @@ const Sl = ({
35345
35345
  try {
35346
35346
  if (c = await t.env.data.forms.get(a.tenant.id, e), !c) throw new b(404, { message: "Form not found" });
35347
35347
  if (l = (c.nodes || []).find(
35348
- (I) => I.id === n && I.type === "STEP"
35348
+ (O) => O.id === n && O.type === "STEP"
35349
35349
  ), !l)
35350
35350
  throw new b(404, {
35351
35351
  message: "Node not found or not a STEP node"
35352
35352
  });
35353
35353
  d = "components" in l.config ? l.config.components : [];
35354
35354
  const u = await t.req.parseBody(), f = [], g = {};
35355
- for (const I of d)
35356
- if (I.type === "LEGAL") {
35357
- const O = I.id, A = !!I.required, N = u[O];
35358
- A && (!N || N === "") ? f.push(O) : typeof N == "string" && (g[O] = N);
35355
+ for (const O of d)
35356
+ if (O.type === "LEGAL") {
35357
+ const I = O.id, A = !!O.required, N = u[I];
35358
+ A && (!N || N === "") ? f.push(I) : typeof N == "string" && (g[I] = N);
35359
35359
  }
35360
35360
  if (f.length > 0)
35361
35361
  return t.html(
@@ -35503,7 +35503,7 @@ const Sl = ({
35503
35503
  user: i,
35504
35504
  className: s
35505
35505
  }) => {
35506
- const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_border || "#d1d5db", u = e?.colors?.widget_background || "#ffffff", f = e?.colors?.widget_border || "#e5e7eb", g = e?.borders?.widget_corner_radius || 8, _ = e?.borders?.button_border_radius || 4, w = e?.borders?.show_widget_shadow ?? !0, x = e?.fonts?.title?.size || 24, E = e?.fonts?.title?.bold ?? !0, I = e?.fonts?.body_text?.size || 14, O = {
35506
+ const a = e?.colors?.primary_button || n?.colors?.primary || "#0066cc", c = e?.colors?.primary_button_label || "#ffffff", l = e?.colors?.body_text || "#333333", d = e?.colors?.input_border || "#d1d5db", u = e?.colors?.widget_background || "#ffffff", f = e?.colors?.widget_border || "#e5e7eb", g = e?.borders?.widget_corner_radius || 8, _ = e?.borders?.button_border_radius || 4, w = e?.borders?.show_widget_shadow ?? !0, x = e?.fonts?.title?.size || 24, E = e?.fonts?.title?.bold ?? !0, O = e?.fonts?.body_text?.size || 14, I = {
35507
35507
  backgroundColor: u,
35508
35508
  borderColor: f,
35509
35509
  borderRadius: `${g}px`,
@@ -35514,7 +35514,7 @@ const Sl = ({
35514
35514
  fontWeight: E ? "700" : "400",
35515
35515
  color: e?.colors?.header || l
35516
35516
  }, N = {
35517
- fontSize: `${I}px`,
35517
+ fontSize: `${O}px`,
35518
35518
  color: e?.colors?.input_labels_placeholders || "#6b7280"
35519
35519
  }, T = {
35520
35520
  backgroundColor: a,
@@ -35527,14 +35527,14 @@ const Sl = ({
35527
35527
  borderRadius: `${_}px`
35528
35528
  }, Q = {
35529
35529
  color: e?.colors?.links_focused_components || a,
35530
- fontSize: `${I}px`
35530
+ fontSize: `${O}px`
35531
35531
  }, X = {
35532
35532
  borderColor: d,
35533
35533
  borderRadius: `${_}px`,
35534
- fontSize: `${I}px`,
35534
+ fontSize: `${O}px`,
35535
35535
  color: l
35536
35536
  }, q = e?.widget?.logo_position || "center", de = q === "left" ? "text-left" : q === "right" ? "text-right" : "text-center", ue = e?.widget?.logo_url || n?.logo_url, ge = q !== "none" && ue;
35537
- return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", s), children: /* @__PURE__ */ p(wn, { style: O, className: "border", children: [
35537
+ return /* @__PURE__ */ p("div", { className: te("flex flex-col gap-6 w-full max-w-sm", s), children: /* @__PURE__ */ p(wn, { style: I, className: "border", children: [
35538
35538
  /* @__PURE__ */ p(bn, { children: [
35539
35539
  ge && /* @__PURE__ */ p("div", { className: te("mb-4", de), children: /* @__PURE__ */ p(Zt, { theme: e, branding: n }) }),
35540
35540
  /* @__PURE__ */ p(vn, { style: A, children: y.t("impersonation", "Impersonation") }),
@@ -35553,7 +35553,7 @@ const Sl = ({
35553
35553
  "p",
35554
35554
  {
35555
35555
  className: "font-semibold",
35556
- style: { fontSize: `${I}px` },
35556
+ style: { fontSize: `${O}px` },
35557
35557
  children: i.email
35558
35558
  }
35559
35559
  )
@@ -39352,59 +39352,66 @@ async function JZ(t, e) {
39352
39352
  "https://localhost:5173/auth-callback",
39353
39353
  "https://localhost:3000/auth-callback"
39354
39354
  ],
39355
- debug: d = !0
39355
+ allowedLogoutUrls: d = [
39356
+ "https://manage.authhero.net",
39357
+ "https://local.authhero.net",
39358
+ "https://localhost:5173",
39359
+ "https://localhost:3000"
39360
+ ],
39361
+ debug: u = !0
39356
39362
  } = e;
39357
- await t.tenants.get(i) ? d && console.log(`Tenant "${i}" already exists, skipping...`) : (d && console.log(`Creating tenant "${i}"...`), await t.tenants.create({
39363
+ await t.tenants.get(i) ? u && console.log(`Tenant "${i}" already exists, skipping...`) : (u && console.log(`Creating tenant "${i}"...`), await t.tenants.create({
39358
39364
  id: i,
39359
39365
  friendly_name: s,
39360
39366
  audience: a,
39361
39367
  sender_email: "noreply@example.com",
39362
39368
  sender_name: "AuthHero"
39363
- }), d && console.log("✅ Tenant created"));
39364
- const { signingKeys: f } = await t.keys.list({ q: "type:jwt_signing" });
39365
- if (f.length === 0) {
39366
- d && console.log("Creating signing key...");
39369
+ }), u && console.log("✅ Tenant created"));
39370
+ const { signingKeys: g } = await t.keys.list({ q: "type:jwt_signing" });
39371
+ if (g.length === 0) {
39372
+ u && console.log("Creating signing key...");
39367
39373
  const I = await Sa({
39368
39374
  name: `CN=${i}`
39369
39375
  });
39370
- await t.keys.create(I), d && console.log("✅ Signing key created");
39371
- } else d && console.log("Signing key already exists, skipping...");
39372
- const g = await t.users.list(i, {
39376
+ await t.keys.create(I), u && console.log("✅ Signing key created");
39377
+ } else u && console.log("Signing key already exists, skipping...");
39378
+ const _ = await t.users.list(i, {
39373
39379
  q: `email:${n}`
39374
39380
  });
39375
- let _;
39376
- if (g.users.length === 0) {
39377
- d && console.log(`Creating admin user "${n}"...`), _ = (await t.users.create(i, {
39381
+ let w;
39382
+ if (_.users.length === 0) {
39383
+ u && console.log(`Creating admin user "${n}"...`), w = (await t.users.create(i, {
39378
39384
  user_id: `auth2|${he()}`,
39379
39385
  email: n,
39380
39386
  email_verified: !0,
39381
39387
  connection: "Username-Password-Authentication",
39382
39388
  provider: "auth2"
39383
39389
  })).user_id;
39384
- const O = await On.hash(r, 10);
39390
+ const A = await On.hash(r, 10);
39385
39391
  await t.passwords.create(i, {
39386
- user_id: _,
39387
- password: O,
39392
+ user_id: w,
39393
+ password: A,
39388
39394
  algorithm: "bcrypt",
39389
39395
  is_current: !0
39390
- }), d && (console.log("✅ Admin user created"), console.log(` Email: ${n}`));
39396
+ }), u && (console.log("✅ Admin user created"), console.log(` Email: ${n}`));
39391
39397
  } else
39392
- _ = g.users[0].user_id, d && console.log(`Admin user "${n}" already exists, skipping...`);
39398
+ w = _.users[0].user_id, u && console.log(`Admin user "${n}" already exists, skipping...`);
39393
39399
  return (await t.connections.list(i)).connections.some(
39394
39400
  (I) => I.name === "Username-Password-Authentication"
39395
- ) ? d && console.log("Password connection already exists, skipping...") : (d && console.log("Creating password connection..."), await t.connections.create(i, {
39401
+ ) ? u && console.log("Password connection already exists, skipping...") : (u && console.log("Creating password connection..."), await t.connections.create(i, {
39396
39402
  name: "Username-Password-Authentication",
39397
39403
  strategy: "Username-Password-Authentication",
39398
39404
  options: {}
39399
- }), d && console.log("✅ Password connection created")), await t.clients.get(i, c) ? d && console.log("Default client already exists, skipping...") : (d && console.log("Creating default client..."), await t.clients.create(i, {
39405
+ }), u && console.log("✅ Password connection created")), await t.clients.get(i, c) ? u && console.log("Default client already exists, skipping...") : (u && console.log("Creating default client..."), await t.clients.create(i, {
39400
39406
  client_id: c,
39401
39407
  name: "Default Application",
39402
39408
  callbacks: l,
39409
+ allowed_logout_urls: d,
39403
39410
  connections: ["Username-Password-Authentication"]
39404
- }), d && (console.log("✅ Default client created"), console.log(` Client ID: ${c}`), console.log(` Callback URLs: ${l.join(", ")}`))), d && console.log(`
39411
+ }), u && (console.log("✅ Default client created"), console.log(` Client ID: ${c}`), console.log(` Callback URLs: ${l.join(", ")}`), console.log(` Allowed Logout URLs: ${d.join(", ")}`))), u && console.log(`
39405
39412
  🎉 Seeding complete!`), {
39406
39413
  tenantId: i,
39407
- userId: _,
39414
+ userId: w,
39408
39415
  email: n,
39409
39416
  clientId: c
39410
39417
  };