@stackframe/stack 2.7.12 → 2.7.14

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/credential-sign-in.js.map +1 -1
  3. package/dist/components/credential-sign-up.js.map +1 -1
  4. package/dist/components/elements/form-warning.js.map +1 -1
  5. package/dist/components/elements/maybe-full-page.js.map +1 -1
  6. package/dist/components/elements/separator-with-text.js.map +1 -1
  7. package/dist/components/elements/sidebar-layout.js.map +1 -1
  8. package/dist/components/elements/ssr-layout-effect.js.map +1 -1
  9. package/dist/components/elements/user-avatar.js.map +1 -1
  10. package/dist/components/magic-link-sign-in.js.map +1 -1
  11. package/dist/components/message-cards/known-error-message-card.js.map +1 -1
  12. package/dist/components/message-cards/message-card.js.map +1 -1
  13. package/dist/components/message-cards/predefined-message-card.js.map +1 -1
  14. package/dist/components/oauth-button-group.js.map +1 -1
  15. package/dist/components/oauth-button.js.map +1 -1
  16. package/dist/components/passkey-button.js.map +1 -1
  17. package/dist/components/profile-image-editor.js.map +1 -1
  18. package/dist/components/selected-team-switcher.js.map +1 -1
  19. package/dist/components/team-icon.js.map +1 -1
  20. package/dist/components/user-button.js.map +1 -1
  21. package/dist/components-page/account-settings.js +9 -1
  22. package/dist/components-page/account-settings.js.map +1 -1
  23. package/dist/components-page/auth-page.js.map +1 -1
  24. package/dist/components-page/email-verification.js.map +1 -1
  25. package/dist/components-page/error-page.js.map +1 -1
  26. package/dist/components-page/forgot-password.js.map +1 -1
  27. package/dist/components-page/magic-link-callback.js.map +1 -1
  28. package/dist/components-page/oauth-callback.js.map +1 -1
  29. package/dist/components-page/password-reset.js.map +1 -1
  30. package/dist/components-page/sign-in.js.map +1 -1
  31. package/dist/components-page/sign-out.js.map +1 -1
  32. package/dist/components-page/sign-up.js.map +1 -1
  33. package/dist/components-page/stack-handler.js.map +1 -1
  34. package/dist/components-page/team-creation.js.map +1 -1
  35. package/dist/components-page/team-invitation.js.map +1 -1
  36. package/dist/esm/components/credential-sign-in.js.map +1 -1
  37. package/dist/esm/components/credential-sign-up.js.map +1 -1
  38. package/dist/esm/components/elements/form-warning.js.map +1 -1
  39. package/dist/esm/components/elements/maybe-full-page.js.map +1 -1
  40. package/dist/esm/components/elements/separator-with-text.js.map +1 -1
  41. package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
  42. package/dist/esm/components/elements/ssr-layout-effect.js.map +1 -1
  43. package/dist/esm/components/elements/user-avatar.js.map +1 -1
  44. package/dist/esm/components/magic-link-sign-in.js.map +1 -1
  45. package/dist/esm/components/message-cards/known-error-message-card.js.map +1 -1
  46. package/dist/esm/components/message-cards/message-card.js.map +1 -1
  47. package/dist/esm/components/message-cards/predefined-message-card.js.map +1 -1
  48. package/dist/esm/components/oauth-button-group.js.map +1 -1
  49. package/dist/esm/components/oauth-button.js.map +1 -1
  50. package/dist/esm/components/passkey-button.js.map +1 -1
  51. package/dist/esm/components/profile-image-editor.js.map +1 -1
  52. package/dist/esm/components/selected-team-switcher.js.map +1 -1
  53. package/dist/esm/components/team-icon.js.map +1 -1
  54. package/dist/esm/components/user-button.js.map +1 -1
  55. package/dist/esm/components-page/account-settings.js +11 -3
  56. package/dist/esm/components-page/account-settings.js.map +1 -1
  57. package/dist/esm/components-page/auth-page.js.map +1 -1
  58. package/dist/esm/components-page/email-verification.js.map +1 -1
  59. package/dist/esm/components-page/error-page.js.map +1 -1
  60. package/dist/esm/components-page/forgot-password.js.map +1 -1
  61. package/dist/esm/components-page/magic-link-callback.js.map +1 -1
  62. package/dist/esm/components-page/oauth-callback.js.map +1 -1
  63. package/dist/esm/components-page/password-reset.js.map +1 -1
  64. package/dist/esm/components-page/sign-in.js.map +1 -1
  65. package/dist/esm/components-page/sign-out.js.map +1 -1
  66. package/dist/esm/components-page/sign-up.js.map +1 -1
  67. package/dist/esm/components-page/stack-handler.js.map +1 -1
  68. package/dist/esm/components-page/team-creation.js.map +1 -1
  69. package/dist/esm/components-page/team-invitation.js.map +1 -1
  70. package/dist/esm/generated/global-css.js +1 -1
  71. package/dist/esm/generated/global-css.js.map +1 -1
  72. package/dist/esm/generated/quetzal-translations.js.map +1 -1
  73. package/dist/esm/index.js +3 -5
  74. package/dist/esm/index.js.map +1 -1
  75. package/dist/esm/lib/auth.js.map +1 -1
  76. package/dist/esm/lib/cookie.js +15 -0
  77. package/dist/esm/lib/cookie.js.map +1 -1
  78. package/dist/esm/lib/hooks.js +2 -2
  79. package/dist/esm/lib/hooks.js.map +1 -1
  80. package/dist/esm/lib/stack-app.js +69 -36
  81. package/dist/esm/lib/stack-app.js.map +1 -1
  82. package/dist/esm/lib/translations.js.map +1 -1
  83. package/dist/esm/providers/stack-provider-client.js.map +1 -1
  84. package/dist/esm/providers/stack-provider.js.map +1 -1
  85. package/dist/esm/providers/theme-provider.js.map +1 -1
  86. package/dist/esm/providers/translation-provider-client.js.map +1 -1
  87. package/dist/esm/providers/translation-provider.js.map +1 -1
  88. package/dist/esm/utils/browser-script.js.map +1 -1
  89. package/dist/esm/utils/constants.js.map +1 -1
  90. package/dist/esm/utils/url.js +1 -1
  91. package/dist/esm/utils/url.js.map +1 -1
  92. package/dist/generated/global-css.d.mts +1 -1
  93. package/dist/generated/global-css.d.ts +1 -1
  94. package/dist/generated/global-css.js +1 -1
  95. package/dist/generated/global-css.js.map +1 -1
  96. package/dist/generated/quetzal-translations.js.map +1 -1
  97. package/dist/index.d.mts +8 -8
  98. package/dist/index.d.ts +8 -8
  99. package/dist/index.js +3 -3
  100. package/dist/index.js.map +1 -1
  101. package/dist/lib/auth.js.map +1 -1
  102. package/dist/lib/cookie.d.mts +2 -1
  103. package/dist/lib/cookie.d.ts +2 -1
  104. package/dist/lib/cookie.js +16 -0
  105. package/dist/lib/cookie.js.map +1 -1
  106. package/dist/lib/hooks.js +2 -2
  107. package/dist/lib/hooks.js.map +1 -1
  108. package/dist/lib/stack-app.d.mts +12 -8
  109. package/dist/lib/stack-app.d.ts +12 -8
  110. package/dist/lib/stack-app.js +68 -35
  111. package/dist/lib/stack-app.js.map +1 -1
  112. package/dist/lib/translations.js.map +1 -1
  113. package/dist/providers/stack-provider-client.js.map +1 -1
  114. package/dist/providers/stack-provider.js.map +1 -1
  115. package/dist/providers/theme-provider.js.map +1 -1
  116. package/dist/providers/translation-provider-client.js.map +1 -1
  117. package/dist/providers/translation-provider.js.map +1 -1
  118. package/dist/utils/browser-script.js.map +1 -1
  119. package/dist/utils/constants.js.map +1 -1
  120. package/dist/utils/url.js +1 -1
  121. package/dist/utils/url.js.map +1 -1
  122. package/package.json +10 -13
  123. package/dist/esm/utils/email.js +0 -10
  124. package/dist/esm/utils/email.js.map +0 -1
  125. package/dist/utils/email.d.mts +0 -3
  126. package/dist/utils/email.d.ts +0 -3
  127. package/dist/utils/email.js +0 -35
  128. package/dist/utils/email.js.map +0 -1
@@ -23,9 +23,9 @@ import * as NextNavigationUnscrambled from "next/navigation";
23
23
  import React, { useCallback, useMemo } from "react";
24
24
  import { constructRedirectUrl } from "../utils/url";
25
25
  import { addNewOAuthProviderOrScope, callOAuthCallback, signInWithOAuth } from "./auth";
26
- import { createBrowserCookieHelper, createCookieHelper, deleteCookieClient, getCookieClient, setOrDeleteCookie, setOrDeleteCookieClient } from "./cookie";
26
+ import { createBrowserCookieHelper, createCookieHelper, createEmptyCookieHelper, deleteCookieClient, getCookieClient, setOrDeleteCookie, setOrDeleteCookieClient } from "./cookie";
27
27
  var NextNavigation = scrambleDuringCompileTime(NextNavigationUnscrambled);
28
- var clientVersion = "js @stackframe/stack@2.7.12";
28
+ var clientVersion = "js @stackframe/stack@2.7.14";
29
29
  function getUrls(partial) {
30
30
  const handler = partial.handler ?? "/handler";
31
31
  const home = partial.home ?? "/";
@@ -50,18 +50,6 @@ function getUrls(partial) {
50
50
  ...filterUndefined(partial)
51
51
  };
52
52
  }
53
- async function _redirectTo(url, options) {
54
- if (isReactServer) {
55
- NextNavigation.redirect(url.toString(), options?.replace ? NextNavigation.RedirectType.replace : NextNavigation.RedirectType.push);
56
- } else {
57
- if (options?.replace) {
58
- window.location.replace(url);
59
- } else {
60
- window.location.assign(url);
61
- }
62
- await wait(2e3);
63
- }
64
- }
65
53
  function getDefaultProjectId() {
66
54
  return process.env.NEXT_PUBLIC_STACK_PROJECT_ID || throwErr(new Error("Welcome to Stack Auth! It seems that you haven't provided a project ID. Please create a project on the Stack dashboard at https://app.stack-auth.com and put it in the NEXT_PUBLIC_STACK_PROJECT_ID environment variable."));
67
55
  }
@@ -75,7 +63,8 @@ function getDefaultSuperSecretAdminKey() {
75
63
  return process.env.STACK_SUPER_SECRET_ADMIN_KEY || throwErr(new Error("No super secret admin key provided. Please copy your key from the Stack dashboard and put it in the STACK_SUPER_SECRET_ADMIN_KEY environment variable."));
76
64
  }
77
65
  function getDefaultBaseUrl() {
78
- return process.env.NEXT_PUBLIC_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_URL || defaultBaseUrl;
66
+ const url = process.env.NEXT_PUBLIC_STACK_API_URL || process.env.NEXT_PUBLIC_STACK_URL || defaultBaseUrl;
67
+ return url.endsWith("/") ? url.slice(0, -1) : url;
79
68
  }
80
69
  var defaultBaseUrl = "https://api.stack-auth.com";
81
70
  function createEmptyTokenStore() {
@@ -233,6 +222,8 @@ var _StackClientAppImpl = class __StackClientAppImpl {
233
222
  });
234
223
  }
235
224
  this._tokenStoreInit = _options.tokenStore;
225
+ this._redirectMethod = _options.redirectMethod || "none";
226
+ this._redirectMethod = _options.redirectMethod || "nextjs";
236
227
  this._urlOptions = _options.urls ?? {};
237
228
  this._oauthScopesOnSignIn = _options.oauthScopesOnSignIn ?? {};
238
229
  if (_options.uniqueIdentifier) {
@@ -246,6 +237,13 @@ var _StackClientAppImpl = class __StackClientAppImpl {
246
237
  }
247
238
  }
248
239
  }
240
+ async _createCookieHelper() {
241
+ if (this._tokenStoreInit === "nextjs-cookie" || this._tokenStoreInit === "cookie") {
242
+ return await createCookieHelper();
243
+ } else {
244
+ return await createEmptyCookieHelper();
245
+ }
246
+ }
249
247
  async _getUserOAuthConnectionCacheFn(options) {
250
248
  const user = await options.getUser();
251
249
  let hasConnection = true;
@@ -483,7 +481,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
483
481
  return session;
484
482
  }
485
483
  async _getSession(overrideTokenStoreInit) {
486
- const tokenStore = this._getOrCreateTokenStore(await createCookieHelper(), overrideTokenStoreInit);
484
+ const tokenStore = this._getOrCreateTokenStore(await this._createCookieHelper(), overrideTokenStoreInit);
487
485
  return this._getSessionFromTokenStore(tokenStore);
488
486
  }
489
487
  _useSession(overrideTokenStoreInit) {
@@ -501,7 +499,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
501
499
  if (!("accessToken" in tokens) || !("refreshToken" in tokens)) {
502
500
  throw new StackAssertionError("Invalid tokens object; can't sign in with this", { tokens });
503
501
  }
504
- const tokenStore = this._getOrCreateTokenStore(await createCookieHelper());
502
+ const tokenStore = this._getOrCreateTokenStore(await this._createCookieHelper());
505
503
  tokenStore.set(tokens);
506
504
  }
507
505
  _hasPersistentTokenStore(overrideTokenStoreInit) {
@@ -571,8 +569,8 @@ var _StackClientAppImpl = class __StackClientAppImpl {
571
569
  clientMetadata: crud.client_metadata,
572
570
  clientReadOnlyMetadata: crud.client_read_only_metadata,
573
571
  async inviteUser(options) {
574
- if (!options.callbackUrl && typeof window === "undefined") {
575
- throw new Error("Cannot invite user without a callback URL from the server. Make sure you pass the `callbackUrl` option: `inviteUser({ email, callbackUrl: ... })`");
572
+ if (!options.callbackUrl && !await app._getCurrentUrl()) {
573
+ throw new Error("Cannot invite user without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `inviteUser({ email, callbackUrl: ... })`");
576
574
  }
577
575
  await app._interface.sendTeamInvitation({
578
576
  teamId: crud.id,
@@ -652,7 +650,11 @@ var _StackClientAppImpl = class __StackClientAppImpl {
652
650
  const tokens = await this.currentSession.getTokens();
653
651
  return tokens;
654
652
  },
655
- async registerPasskey() {
653
+ async registerPasskey(options) {
654
+ const hostname = (await app._getCurrentUrl())?.hostname;
655
+ if (!hostname) {
656
+ throw new StackAssertionError("hostname must be provided if the Stack App does not have a redirect method");
657
+ }
656
658
  const initiationResult = await app._interface.initiatePasskeyRegistration({}, session);
657
659
  if (initiationResult.status !== "ok") {
658
660
  return Result.error(new KnownErrors.PasskeyRegistrationFailed("Failed to get initiation options for passkey registration"));
@@ -661,7 +663,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
661
663
  if (options_json.rp.id !== "THIS_VALUE_WILL_BE_REPLACED.example.com") {
662
664
  throw new StackAssertionError(`Expected returned RP ID from server to equal sentinel, but found ${options_json.rp.id}`);
663
665
  }
664
- options_json.rp.id = window.location.hostname;
666
+ options_json.rp.id = hostname;
665
667
  let attResp;
666
668
  try {
667
669
  attResp = await startRegistration({ optionsJSON: options_json });
@@ -800,8 +802,8 @@ var _StackClientAppImpl = class __StackClientAppImpl {
800
802
  if (!crud.primary_email) {
801
803
  throw new StackAssertionError("User does not have a primary email");
802
804
  }
803
- if (!options?.callbackUrl && typeof window === "undefined") {
804
- throw new Error("Cannot send verification email without a callback URL from the server. Make sure you pass the `callbackUrl` option: `sendVerificationEmail({ callbackUrl: ... })`");
805
+ if (!options?.callbackUrl && !await app._getCurrentUrl()) {
806
+ throw new Error("Cannot send verification email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendVerificationEmail({ callbackUrl: ... })`");
805
807
  }
806
808
  return await app._interface.sendVerificationEmail(crud.primary_email, options?.callbackUrl ?? constructRedirectUrl(app.urls.emailVerification), session);
807
809
  },
@@ -889,11 +891,32 @@ var _StackClientAppImpl = class __StackClientAppImpl {
889
891
  get urls() {
890
892
  return getUrls(this._urlOptions);
891
893
  }
894
+ async _getCurrentUrl() {
895
+ if (this._redirectMethod === "none") {
896
+ return null;
897
+ }
898
+ return new URL(window.location.href);
899
+ }
900
+ async _redirectTo(options) {
901
+ if (this._redirectMethod === "none") {
902
+ return;
903
+ }
904
+ if (isReactServer && this._redirectMethod === "nextjs") {
905
+ NextNavigation.redirect(options.url.toString(), options.replace ? NextNavigation.RedirectType.replace : NextNavigation.RedirectType.push);
906
+ } else {
907
+ if (options.replace) {
908
+ window.location.replace(options.url);
909
+ } else {
910
+ window.location.assign(options.url);
911
+ }
912
+ await wait(2e3);
913
+ }
914
+ }
892
915
  async _redirectIfTrusted(url, options) {
893
916
  if (!await this._isTrusted(url)) {
894
917
  throw new Error(`Redirect URL ${url} is not trusted; should be relative.`);
895
918
  }
896
- return await _redirectTo(url, options);
919
+ return await this._redirectTo({ url, ...options });
897
920
  }
898
921
  async _redirectToHandler(handlerName, options) {
899
922
  let url = this.urls[handlerName];
@@ -977,14 +1000,14 @@ var _StackClientAppImpl = class __StackClientAppImpl {
977
1000
  return await this._redirectToHandler("teamInvitation", options);
978
1001
  }
979
1002
  async sendForgotPasswordEmail(email, options) {
980
- if (!options?.callbackUrl && typeof window === "undefined") {
981
- throw new Error("Cannot send forgot password email without a callback URL from the server. Make sure you pass the `callbackUrl` option: `sendForgotPasswordEmail({ email, callbackUrl: ... })`");
1003
+ if (!options?.callbackUrl && !await this._getCurrentUrl()) {
1004
+ throw new Error("Cannot send forgot password email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendForgotPasswordEmail({ email, callbackUrl: ... })`");
982
1005
  }
983
1006
  return await this._interface.sendForgotPasswordEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.urls.passwordReset));
984
1007
  }
985
1008
  async sendMagicLinkEmail(email, options) {
986
- if (!options?.callbackUrl && typeof window === "undefined") {
987
- throw new Error("Cannot send magic link email without a callback URL from the server. Make sure you pass the `callbackUrl` option: `sendMagicLinkEmail({ email, callbackUrl: ... })`");
1009
+ if (!options?.callbackUrl && !await this._getCurrentUrl()) {
1010
+ throw new Error("Cannot send magic link email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendMagicLinkEmail({ email, callbackUrl: ... })`");
988
1011
  }
989
1012
  return await this._interface.sendMagicLinkEmail(email, options?.callbackUrl ?? constructRedirectUrl(this.urls.magicLinkCallback));
990
1013
  }
@@ -1081,6 +1104,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
1081
1104
  return res;
1082
1105
  }
1083
1106
  async signInWithOAuth(provider) {
1107
+ if (typeof window === "undefined") {
1108
+ throw new Error("signInWithOAuth can currently only be called in a browser environment");
1109
+ }
1084
1110
  this._ensurePersistentTokenStore();
1085
1111
  await signInWithOAuth(
1086
1112
  this._interface,
@@ -1224,6 +1250,9 @@ var _StackClientAppImpl = class __StackClientAppImpl {
1224
1250
  }
1225
1251
  }
1226
1252
  async callOAuthCallback() {
1253
+ if (typeof window === "undefined") {
1254
+ throw new Error("callOAuthCallback can currently only be called in a browser environment");
1255
+ }
1227
1256
  this._ensurePersistentTokenStore();
1228
1257
  let result;
1229
1258
  try {
@@ -1233,13 +1262,15 @@ var _StackClientAppImpl = class __StackClientAppImpl {
1233
1262
  } catch (e) {
1234
1263
  if (e instanceof KnownErrors.InvalidTotpCode) {
1235
1264
  alert("Invalid TOTP code. Please try signing in again.");
1265
+ return false;
1266
+ } else {
1267
+ throw e;
1236
1268
  }
1237
- throw e;
1238
1269
  }
1239
1270
  if (result.status === "ok" && result.data) {
1240
1271
  await this._signInToAccountWithTokens(result.data);
1241
1272
  if ("afterCallbackRedirectUrl" in result.data && result.data.afterCallbackRedirectUrl) {
1242
- await _redirectTo(result.data.afterCallbackRedirectUrl, { replace: true });
1273
+ await this._redirectTo({ url: result.data.afterCallbackRedirectUrl, replace: true });
1243
1274
  return true;
1244
1275
  } else if (result.data.newUser) {
1245
1276
  await this.redirectToAfterSignUp({ replace: true });
@@ -1255,7 +1286,7 @@ var _StackClientAppImpl = class __StackClientAppImpl {
1255
1286
  await storeLock.withWriteLock(async () => {
1256
1287
  await this._interface.signOut(session);
1257
1288
  if (options?.redirectUrl) {
1258
- await _redirectTo(options.redirectUrl);
1289
+ await this._redirectTo({ url: options.redirectUrl, replace: true });
1259
1290
  } else {
1260
1291
  await this.redirectToAfterSignOut();
1261
1292
  }
@@ -1482,8 +1513,8 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1482
1513
  isPrimary: crud.is_primary,
1483
1514
  usedForAuth: crud.used_for_auth,
1484
1515
  async sendVerificationEmail(options) {
1485
- if (!options?.callbackUrl && typeof window === "undefined") {
1486
- throw new Error("Cannot send verification email without a callback URL from the server. Make sure you pass the `callbackUrl` option: `sendVerificationEmail({ callbackUrl: ... })`");
1516
+ if (!options?.callbackUrl && !await app._getCurrentUrl()) {
1517
+ throw new Error("Cannot send verification email without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `sendVerificationEmail({ callbackUrl: ... })`");
1487
1518
  }
1488
1519
  await app._interface.sendServerContactChannelVerificationEmail(userId, crud.id, options?.callbackUrl ?? constructRedirectUrl(app.urls.emailVerification));
1489
1520
  },
@@ -1714,8 +1745,8 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1714
1745
  await app._serverTeamMemberProfilesCache.refresh([crud.id]);
1715
1746
  },
1716
1747
  async inviteUser(options) {
1717
- if (!options.callbackUrl && typeof window === "undefined") {
1718
- throw new Error("Cannot invite user without a callback URL from the server. Make sure you pass the `callbackUrl` option: `inviteUser({ email, callbackUrl: ... })`");
1748
+ if (!options.callbackUrl && !await app._getCurrentUrl()) {
1749
+ throw new Error("Cannot invite user without a callback URL from the server or without a redirect method. Make sure you pass the `callbackUrl` option: `inviteUser({ email, callbackUrl: ... })`");
1719
1750
  }
1720
1751
  await app._interface.sendServerTeamInvitation({
1721
1752
  teamId: crud.id,
@@ -1863,7 +1894,9 @@ var _StackServerAppImpl = class extends _StackClientAppImpl {
1863
1894
  async _refreshUsers() {
1864
1895
  await Promise.all([
1865
1896
  super._refreshUsers(),
1866
- this._serverUsersCache.refreshWhere(() => true)
1897
+ this._serverUserCache.refreshWhere(() => true),
1898
+ this._serverUsersCache.refreshWhere(() => true),
1899
+ this._serverContactChannelsCache.refreshWhere(() => true)
1867
1900
  ]);
1868
1901
  }
1869
1902
  };