@stytch/vanilla-js 4.2.0 → 4.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 4.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c50b9ad]
8
+ - @stytch/core@2.3.0
9
+
3
10
  ## 4.2.0
4
11
 
5
12
  ### Minor Changes
@@ -234,6 +234,10 @@ interface Member {
234
234
  role_id: string;
235
235
  sources: RoleSource[];
236
236
  }[];
237
+ /**
238
+ * The member's default MFA method.
239
+ */
240
+ default_mfa_method: string;
237
241
  }
238
242
  type B2BAuthenticateResponse = ResponseCommon & {
239
243
  /**
@@ -376,6 +380,19 @@ interface Organization {
376
380
  * The list's accepted values are: sso, magic_link, password, google_oauth, and microsoft_oauth.
377
381
  */
378
382
  allowed_auth_methods: string[];
383
+ /**
384
+ * The setting that controls which mfa methods can be used by Members of an Organization.
385
+ * The accepted values are:
386
+ * ALL_ALLOWED – the default setting which allows all MFA methods to be used.
387
+ * RESTRICTED – only methods that comply with allowed_mfa_methods can be used for MFA. This setting does not apply to Members with is_breakglass set to true.
388
+ */
389
+ mfa_methods?: string;
390
+ /**
391
+ * An array of allowed MFA methods.
392
+ * This list is enforced when mfa_methods is set to RESTRICTED.
393
+ * The list's accepted values are: sms_otp and totp.
394
+ */
395
+ allowed_mfa_methods?: ("sms_otp" | "totp")[];
379
396
  /**
380
397
  * The setting that controls the MFA policy for all Members in the Organization. The accepted values are:
381
398
  * REQUIRED_FOR_ALL – All Members within the Organization will be required to complete MFA every time they wish to log in.
@@ -234,6 +234,10 @@ interface Member {
234
234
  role_id: string;
235
235
  sources: RoleSource[];
236
236
  }[];
237
+ /**
238
+ * The member's default MFA method.
239
+ */
240
+ default_mfa_method: string;
237
241
  }
238
242
  type B2BAuthenticateResponse = ResponseCommon & {
239
243
  /**
@@ -376,6 +380,19 @@ interface Organization {
376
380
  * The list's accepted values are: sso, magic_link, password, google_oauth, and microsoft_oauth.
377
381
  */
378
382
  allowed_auth_methods: string[];
383
+ /**
384
+ * The setting that controls which mfa methods can be used by Members of an Organization.
385
+ * The accepted values are:
386
+ * ALL_ALLOWED – the default setting which allows all MFA methods to be used.
387
+ * RESTRICTED – only methods that comply with allowed_mfa_methods can be used for MFA. This setting does not apply to Members with is_breakglass set to true.
388
+ */
389
+ mfa_methods?: string;
390
+ /**
391
+ * An array of allowed MFA methods.
392
+ * This list is enforced when mfa_methods is set to RESTRICTED.
393
+ * The list's accepted values are: sms_otp and totp.
394
+ */
395
+ allowed_mfa_methods?: ("sms_otp" | "totp")[];
379
396
  /**
380
397
  * The setting that controls the MFA policy for all Members in the Organization. The accepted values are:
381
398
  * REQUIRED_FOR_ALL – All Members within the Organization will be required to complete MFA every time they wish to log in.
@@ -1884,7 +1884,7 @@ var qe = Promise.resolve({
1884
1884
  return de().wrap(function (t) {
1885
1885
  for (;;) switch (t.prev = t.next) {
1886
1886
  case 0:
1887
- return $e("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
1887
+ return $e("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number).isOptionalString("default_mfa_method", e.default_mfa_method), t.next = 3, this._networkClient.fetchSDK({
1888
1888
  url: "/b2b/organizations/members/update",
1889
1889
  body: e,
1890
1890
  errorMessage: "Failed to update member.",
@@ -3900,7 +3900,7 @@ var Et = /*#__PURE__*/function () {
3900
3900
  },
3901
3901
  sdk: {
3902
3902
  identifier: "Stytch.js Javascript SDK",
3903
- version: "4.2.0"
3903
+ version: "4.2.1"
3904
3904
  }
3905
3905
  });
3906
3906
  }
@@ -11036,7 +11036,7 @@ var td = Ja.a(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral([
11036
11036
  S(i), y(!t), "zxcvbn" === i ? (m(e), A(n.warning)) : "luds" === i && (C(r.missing_characters), O(r.missing_complexity), T(o));
11037
11037
  });
11038
11038
  });
11039
- }, []);
11039
+ }, [e.passwords]);
11040
11040
  qn(function () {
11041
11041
  var e, t;
11042
11042
  var n = new URLSearchParams(window.location.search),
@@ -231,6 +231,10 @@ interface Member {
231
231
  role_id: string;
232
232
  sources: RoleSource[];
233
233
  }[];
234
+ /**
235
+ * The member's default MFA method.
236
+ */
237
+ default_mfa_method: string;
234
238
  }
235
239
  type B2BAuthenticateResponse = ResponseCommon & {
236
240
  /**
@@ -373,6 +377,19 @@ interface Organization {
373
377
  * The list's accepted values are: sso, magic_link, password, google_oauth, and microsoft_oauth.
374
378
  */
375
379
  allowed_auth_methods: string[];
380
+ /**
381
+ * The setting that controls which mfa methods can be used by Members of an Organization.
382
+ * The accepted values are:
383
+ * ALL_ALLOWED – the default setting which allows all MFA methods to be used.
384
+ * RESTRICTED – only methods that comply with allowed_mfa_methods can be used for MFA. This setting does not apply to Members with is_breakglass set to true.
385
+ */
386
+ mfa_methods?: string;
387
+ /**
388
+ * An array of allowed MFA methods.
389
+ * This list is enforced when mfa_methods is set to RESTRICTED.
390
+ * The list's accepted values are: sms_otp and totp.
391
+ */
392
+ allowed_mfa_methods?: ("sms_otp" | "totp")[];
376
393
  /**
377
394
  * The setting that controls the MFA policy for all Members in the Organization. The accepted values are:
378
395
  * REQUIRED_FOR_ALL – All Members within the Organization will be required to complete MFA every time they wish to log in.
@@ -231,6 +231,10 @@ interface Member {
231
231
  role_id: string;
232
232
  sources: RoleSource[];
233
233
  }[];
234
+ /**
235
+ * The member's default MFA method.
236
+ */
237
+ default_mfa_method: string;
234
238
  }
235
239
  type B2BAuthenticateResponse = ResponseCommon & {
236
240
  /**
@@ -373,6 +377,19 @@ interface Organization {
373
377
  * The list's accepted values are: sso, magic_link, password, google_oauth, and microsoft_oauth.
374
378
  */
375
379
  allowed_auth_methods: string[];
380
+ /**
381
+ * The setting that controls which mfa methods can be used by Members of an Organization.
382
+ * The accepted values are:
383
+ * ALL_ALLOWED – the default setting which allows all MFA methods to be used.
384
+ * RESTRICTED – only methods that comply with allowed_mfa_methods can be used for MFA. This setting does not apply to Members with is_breakglass set to true.
385
+ */
386
+ mfa_methods?: string;
387
+ /**
388
+ * An array of allowed MFA methods.
389
+ * This list is enforced when mfa_methods is set to RESTRICTED.
390
+ * The list's accepted values are: sms_otp and totp.
391
+ */
392
+ allowed_mfa_methods?: ("sms_otp" | "totp")[];
376
393
  /**
377
394
  * The setting that controls the MFA policy for all Members in the Organization. The accepted values are:
378
395
  * REQUIRED_FOR_ALL – All Members within the Organization will be required to complete MFA every time they wish to log in.
@@ -1882,7 +1882,7 @@ var Ye = Promise.resolve({
1882
1882
  return de().wrap(function (t) {
1883
1883
  for (;;) switch (t.prev = t.next) {
1884
1884
  case 0:
1885
- return qe("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
1885
+ return qe("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number).isOptionalString("default_mfa_method", e.default_mfa_method), t.next = 3, this._networkClient.fetchSDK({
1886
1886
  url: "/b2b/organizations/members/update",
1887
1887
  body: e,
1888
1888
  errorMessage: "Failed to update member.",
@@ -3898,7 +3898,7 @@ var At = /*#__PURE__*/function () {
3898
3898
  },
3899
3899
  sdk: {
3900
3900
  identifier: "Stytch.js Javascript SDK",
3901
- version: "4.2.0"
3901
+ version: "4.2.1"
3902
3902
  }
3903
3903
  });
3904
3904
  }
@@ -1814,7 +1814,7 @@ var Fe = Promise.resolve({
1814
1814
  return te().wrap(function (t) {
1815
1815
  for (;;) switch (t.prev = t.next) {
1816
1816
  case 0:
1817
- return Be("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
1817
+ return Be("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number).isOptionalString("default_mfa_method", e.default_mfa_method), t.next = 3, this._networkClient.fetchSDK({
1818
1818
  url: "/b2b/organizations/members/update",
1819
1819
  body: e,
1820
1820
  errorMessage: "Failed to update member.",
@@ -3830,7 +3830,7 @@ var ft = /*#__PURE__*/function () {
3830
3830
  },
3831
3831
  sdk: {
3832
3832
  identifier: "Stytch.js Javascript SDK",
3833
- version: "4.2.0"
3833
+ version: "4.2.1"
3834
3834
  }
3835
3835
  });
3836
3836
  }
package/dist/b2b/index.js CHANGED
@@ -1816,7 +1816,7 @@ var je = Promise.resolve({
1816
1816
  return te().wrap(function (t) {
1817
1817
  for (;;) switch (t.prev = t.next) {
1818
1818
  case 0:
1819
- return Re("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number), t.next = 3, this._networkClient.fetchSDK({
1819
+ return Re("stytch.self.update").isOptionalString("name", e.name).isOptionalObject("untrusted_metadata", e.untrusted_metadata).isOptionalBoolean("mfa_enrolled", e.mfa_enrolled).isOptionalString("mfa_phone_number", e.mfa_phone_number).isOptionalString("default_mfa_method", e.default_mfa_method), t.next = 3, this._networkClient.fetchSDK({
1820
1820
  url: "/b2b/organizations/members/update",
1821
1821
  body: e,
1822
1822
  errorMessage: "Failed to update member.",
@@ -3832,7 +3832,7 @@ var mt = /*#__PURE__*/function () {
3832
3832
  },
3833
3833
  sdk: {
3834
3834
  identifier: "Stytch.js Javascript SDK",
3835
- version: "4.2.0"
3835
+ version: "4.2.1"
3836
3836
  }
3837
3837
  });
3838
3838
  }
@@ -10968,7 +10968,7 @@ var Hu = Na.a(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral([
10968
10968
  k(o), v(!t), "zxcvbn" === o ? (m(e), g(n.warning)) : "luds" === o && (E(r.missing_characters), x(r.missing_complexity), P(i));
10969
10969
  });
10970
10970
  });
10971
- }, []);
10971
+ }, [e.passwords]);
10972
10972
  jn(function () {
10973
10973
  var e, t;
10974
10974
  var n = new URLSearchParams(window.location.search),
package/dist/index.esm.js CHANGED
@@ -3814,7 +3814,7 @@ var Qt = /*#__PURE__*/function () {
3814
3814
  },
3815
3815
  sdk: {
3816
3816
  identifier: "Stytch.js Javascript SDK",
3817
- version: "4.2.0"
3817
+ version: "4.2.1"
3818
3818
  }
3819
3819
  });
3820
3820
  }
@@ -8092,7 +8092,7 @@ var bc = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
8092
8092
  }
8093
8093
  }, _callee12);
8094
8094
  }));
8095
- }, [a, e, null === (t = o.oauthOptions) || void 0 === t ? void 0 : t.loginRedirectURL, null === (n = o.oauthOptions) || void 0 === n ? void 0 : n.signupRedirectURL]);
8095
+ }, [a, e, _, null === (t = o.oauthOptions) || void 0 === t ? void 0 : t.loginRedirectURL, null === (n = o.oauthOptions) || void 0 === n ? void 0 : n.signupRedirectURL]);
8096
8096
  mr(function () {
8097
8097
  var e;
8098
8098
  return w().then(function (t) {
@@ -9905,9 +9905,8 @@ var Kl = _defineProperty(_defineProperty(_defineProperty({}, g.SMS, "text messag
9905
9905
  n = _Ls8[1],
9906
9906
  r = Ts(),
9907
9907
  i = Os(),
9908
- o = i.emailMagicLinksOptions;
9909
- if (!o) return Ii.createElement(Ii.Fragment, null);
9910
- var a = i.products.includes(p.passkeys),
9908
+ o = i.emailMagicLinksOptions,
9909
+ a = i.products.includes(p.passkeys),
9911
9910
  _hr31 = hr(""),
9912
9911
  _hr32 = _slicedToArray(_hr31, 2),
9913
9912
  s = _hr32[0],
@@ -9920,6 +9919,7 @@ var Kl = _defineProperty(_defineProperty(_defineProperty({}, g.SMS, "text messag
9920
9919
  _hr36 = _slicedToArray(_hr35, 2),
9921
9920
  d = _hr36[0],
9922
9921
  h = _hr36[1];
9922
+ if (!o) return Ii.createElement(Ii.Fragment, null);
9923
9923
  return Ii.createElement("form", {
9924
9924
  onSubmit: function onSubmit(i) {
9925
9925
  return Rt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
@@ -9975,33 +9975,34 @@ var Kl = _defineProperty(_defineProperty(_defineProperty({}, g.SMS, "text messag
9975
9975
  _Ls10 = _slicedToArray(_Ls9, 2),
9976
9976
  e = _Ls10[1],
9977
9977
  t = Os(),
9978
- n = Ts();
9979
- if (!t.passwordOptions) return Ii.createElement(Ii.Fragment, null);
9980
- var r = t.products.includes(Vs.passkeys),
9978
+ n = Ts(),
9979
+ r = t.passwordOptions,
9980
+ i = t.products.includes(Vs.passkeys),
9981
9981
  _hr37 = hr(""),
9982
9982
  _hr38 = _slicedToArray(_hr37, 2),
9983
- i = _hr38[0],
9984
- o = _hr38[1],
9983
+ o = _hr38[0],
9984
+ a = _hr38[1],
9985
9985
  _hr39 = hr(""),
9986
9986
  _hr40 = _slicedToArray(_hr39, 2),
9987
- a = _hr40[0],
9988
- s = _hr40[1],
9987
+ s = _hr40[0],
9988
+ c = _hr40[1],
9989
9989
  _hr41 = hr(!1),
9990
9990
  _hr42 = _slicedToArray(_hr41, 2),
9991
- c = _hr42[0],
9992
- l = _hr42[1];
9991
+ l = _hr42[0],
9992
+ u = _hr42[1];
9993
+ if (!r) return Ii.createElement(Ii.Fragment, null);
9993
9994
  return Ii.createElement("form", {
9994
9995
  onSubmit: function onSubmit(t) {
9995
9996
  return Rt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
9996
9997
  return _regeneratorRuntime().wrap(function _callee17$(_context17) {
9997
9998
  while (1) switch (_context17.prev = _context17.next) {
9998
9999
  case 0:
9999
- t.preventDefault(), i.match(Kt) ? (s(""), l(!0), pn(n).searchManager.searchUser(i).then(function (_ref74) {
10000
+ t.preventDefault(), o.match(Kt) ? (c(""), u(!0), pn(n).searchManager.searchUser(o).then(function (_ref74) {
10000
10001
  var t = _ref74.userType;
10001
10002
  e({
10002
10003
  type: "update_password_state",
10003
10004
  passwordState: {
10004
- email: i,
10005
+ email: o,
10005
10006
  type: t
10006
10007
  }
10007
10008
  }), e({
@@ -10010,13 +10011,13 @@ var Kl = _defineProperty(_defineProperty(_defineProperty({}, g.SMS, "text messag
10010
10011
  }), pn(n).networkClient.logEvent({
10011
10012
  name: "email_sent",
10012
10013
  details: {
10013
- email: i,
10014
+ email: o,
10014
10015
  type: nc.ResetPassword
10015
10016
  }
10016
10017
  });
10017
10018
  })["catch"](function (e) {
10018
- l(!1), s(e.message);
10019
- })) : s("Invalid email address");
10019
+ u(!1), c(e.message);
10020
+ })) : c("Invalid email address");
10020
10021
  case 1:
10021
10022
  case "end":
10022
10023
  return _context17.stop();
@@ -10031,14 +10032,14 @@ var Kl = _defineProperty(_defineProperty(_defineProperty({}, g.SMS, "text messag
10031
10032
  direction: "column",
10032
10033
  height: 52
10033
10034
  }, Ii.createElement(Zl, {
10034
- email: i,
10035
- setEmail: o,
10036
- hasPasskeys: r
10035
+ email: o,
10036
+ setEmail: a,
10037
+ hasPasskeys: i
10037
10038
  }), Ii.createElement(Rs, {
10038
10039
  size: "helper",
10039
10040
  color: "error"
10040
- }, a)), Ii.createElement(Wl, {
10041
- isSubmitting: c,
10041
+ }, s)), Ii.createElement(Wl, {
10042
+ isSubmitting: l,
10042
10043
  text: "Continue with email"
10043
10044
  })));
10044
10045
  },
@@ -10212,10 +10213,7 @@ var du = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
10212
10213
  conditionalMediation: !0
10213
10214
  }),
10214
10215
  c = _$l.promptAutofill;
10215
- if (c(), i && o) return Ii.createElement(Rs, {
10216
- size: "helper"
10217
- }, "Error: Cannot use both EML and Email OTP");
10218
- a && i && (s = s.filter(function (e) {
10216
+ c(), a && i && (s = s.filter(function (e) {
10219
10217
  return e !== lu.Email;
10220
10218
  })), a && o && (s = s.filter(function (e) {
10221
10219
  return e !== g.Email;
@@ -10223,16 +10221,19 @@ var du = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
10223
10221
  var _hr45 = hr(s[0]),
10224
10222
  _hr46 = _slicedToArray(_hr45, 2),
10225
10223
  l = _hr46[0],
10226
- u = _hr46[1],
10227
- d = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, g.Email, ql), g.WhatsApp, function () {
10228
- return Ii.createElement(Yl, {
10229
- method: g.WhatsApp
10230
- });
10231
- }), g.SMS, function () {
10232
- return Ii.createElement(Yl, {
10233
- method: g.SMS
10234
- });
10235
- }), lu.Email, Jl), uu.Email, Xl);
10224
+ u = _hr46[1];
10225
+ if (i && o) return Ii.createElement(Rs, {
10226
+ size: "helper"
10227
+ }, "Error: Cannot use both EML and Email OTP");
10228
+ var d = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, g.Email, ql), g.WhatsApp, function () {
10229
+ return Ii.createElement(Yl, {
10230
+ method: g.WhatsApp
10231
+ });
10232
+ }), g.SMS, function () {
10233
+ return Ii.createElement(Yl, {
10234
+ method: g.SMS
10235
+ });
10236
+ }), lu.Email, Jl), uu.Email, Xl);
10236
10237
  return Ii.createElement(Ii.Fragment, null, Ii.createElement(au, {
10237
10238
  variant: "warning"
10238
10239
  }), Ii.createElement(Bl, {
@@ -11642,7 +11643,7 @@ var up = function up(_ref85) {
11642
11643
  }).then(function (e) {
11643
11644
  _(p === g.Email ? d : e.number);
11644
11645
  });
11645
- }, [p, d]);
11646
+ }, [p, d, o]);
11646
11647
  return mr(function () {
11647
11648
  6 === h.length && Rt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
11648
11649
  var e, t;
@@ -12371,9 +12372,8 @@ var ph = function ph(e) {
12371
12372
  hh = function hh() {
12372
12373
  var e = Ts(),
12373
12374
  t = Os(),
12374
- n = t.passwordOptions;
12375
- if (!n) return Ii.createElement(Ii.Fragment, null);
12376
- var _Ls19 = Ls(),
12375
+ n = t.passwordOptions,
12376
+ _Ls19 = Ls(),
12377
12377
  _Ls20 = _slicedToArray(_Ls19, 2),
12378
12378
  r = _Ls20[0],
12379
12379
  i = _Ls20[1],
@@ -12439,7 +12439,8 @@ var ph = function ph(e) {
12439
12439
  "invalid_email" === e.error_type && p(e.message);
12440
12440
  });
12441
12441
  });
12442
- }, []);
12442
+ }, [e.passwords]);
12443
+ if (!n) return Ii.createElement(Ii.Fragment, null);
12443
12444
  return Ii.createElement("form", {
12444
12445
  onSubmit: function onSubmit(r) {
12445
12446
  var c, u;
@@ -12507,9 +12508,8 @@ var ph = function ph(e) {
12507
12508
  mh = function mh() {
12508
12509
  var e = Ts(),
12509
12510
  t = Os(),
12510
- n = t.passwordOptions;
12511
- if (!n) return Ii.createElement(Ii.Fragment, null);
12512
- var _Ls21 = Ls(),
12511
+ n = t.passwordOptions,
12512
+ _Ls21 = Ls(),
12513
12513
  _Ls22 = _slicedToArray(_Ls21, 2),
12514
12514
  r = _Ls22[0],
12515
12515
  i = _Ls22[1],
@@ -12531,6 +12531,7 @@ var ph = function ph(e) {
12531
12531
  _hr92 = _slicedToArray(_hr91, 2),
12532
12532
  h = _hr92[0],
12533
12533
  f = _hr92[1];
12534
+ if (!n) return Ii.createElement(Ii.Fragment, null);
12534
12535
  return Ii.createElement(Ns, {
12535
12536
  direction: "column",
12536
12537
  gap: 36
@@ -13522,7 +13523,7 @@ var ph = function ph(e) {
13522
13523
  b(r), v(!n), "zxcvbn" === r ? (f(e), g(t.warning)) : "luds" === r && (k(t.luds_requirements.missing_characters), x(t.luds_requirements.missing_complexity), T(i));
13523
13524
  });
13524
13525
  });
13525
- }, []);
13526
+ }, [e.passwords]);
13526
13527
  mr(function () {
13527
13528
  var e;
13528
13529
  var t = null !== (e = new URLSearchParams(window.location.search).get("stytch_token_type")) && void 0 !== e ? e : "";
@@ -14029,7 +14030,7 @@ var Zh = ys(Ns)(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral
14029
14030
  })["catch"](function (e) {
14030
14031
  console.log(e);
14031
14032
  });
14032
- }, []);
14033
+ }, [e.user]);
14033
14034
  return Ii.createElement(Ns, {
14034
14035
  direction: "column",
14035
14036
  gap: 18,
@@ -3796,7 +3796,7 @@ var Nt = /*#__PURE__*/function () {
3796
3796
  },
3797
3797
  sdk: {
3798
3798
  identifier: "Stytch.js Javascript SDK",
3799
- version: "4.2.0"
3799
+ version: "4.2.1"
3800
3800
  }
3801
3801
  });
3802
3802
  }
@@ -3714,7 +3714,7 @@ var Mt = /*#__PURE__*/function () {
3714
3714
  },
3715
3715
  sdk: {
3716
3716
  identifier: "Stytch.js Javascript SDK",
3717
- version: "4.2.0"
3717
+ version: "4.2.1"
3718
3718
  }
3719
3719
  });
3720
3720
  }
package/dist/index.js CHANGED
@@ -3746,7 +3746,7 @@ var It = /*#__PURE__*/function () {
3746
3746
  },
3747
3747
  sdk: {
3748
3748
  identifier: "Stytch.js Javascript SDK",
3749
- version: "4.2.0"
3749
+ version: "4.2.1"
3750
3750
  }
3751
3751
  });
3752
3752
  }
@@ -8024,7 +8024,7 @@ var hc = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
8024
8024
  }
8025
8025
  }, _callee12);
8026
8026
  }));
8027
- }, [a, e, null === (t = i.oauthOptions) || void 0 === t ? void 0 : t.loginRedirectURL, null === (n = i.oauthOptions) || void 0 === n ? void 0 : n.signupRedirectURL]);
8027
+ }, [a, e, y, null === (t = i.oauthOptions) || void 0 === t ? void 0 : t.loginRedirectURL, null === (n = i.oauthOptions) || void 0 === n ? void 0 : n.signupRedirectURL]);
8028
8028
  ir(function () {
8029
8029
  var e;
8030
8030
  return C().then(function (t) {
@@ -9837,9 +9837,8 @@ var Rl = _defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.
9837
9837
  n = _Cs8[1],
9838
9838
  r = vs(),
9839
9839
  o = _s(),
9840
- i = o.emailMagicLinksOptions;
9841
- if (!i) return bo.createElement(bo.Fragment, null);
9842
- var a = o.products.includes(exports.Products.passkeys),
9840
+ i = o.emailMagicLinksOptions,
9841
+ a = o.products.includes(exports.Products.passkeys),
9843
9842
  _rr31 = rr(""),
9844
9843
  _rr32 = _slicedToArray(_rr31, 2),
9845
9844
  s = _rr32[0],
@@ -9852,6 +9851,7 @@ var Rl = _defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.
9852
9851
  _rr36 = _slicedToArray(_rr35, 2),
9853
9852
  d = _rr36[0],
9854
9853
  p = _rr36[1];
9854
+ if (!i) return bo.createElement(bo.Fragment, null);
9855
9855
  return bo.createElement("form", {
9856
9856
  onSubmit: function onSubmit(o) {
9857
9857
  return Tt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
@@ -9907,33 +9907,34 @@ var Rl = _defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.
9907
9907
  _Cs10 = _slicedToArray(_Cs9, 2),
9908
9908
  e = _Cs10[1],
9909
9909
  t = _s(),
9910
- n = vs();
9911
- if (!t.passwordOptions) return bo.createElement(bo.Fragment, null);
9912
- var r = t.products.includes(Ds.passkeys),
9910
+ n = vs(),
9911
+ r = t.passwordOptions,
9912
+ o = t.products.includes(Ds.passkeys),
9913
9913
  _rr37 = rr(""),
9914
9914
  _rr38 = _slicedToArray(_rr37, 2),
9915
- o = _rr38[0],
9916
- i = _rr38[1],
9915
+ i = _rr38[0],
9916
+ a = _rr38[1],
9917
9917
  _rr39 = rr(""),
9918
9918
  _rr40 = _slicedToArray(_rr39, 2),
9919
- a = _rr40[0],
9920
- s = _rr40[1],
9919
+ s = _rr40[0],
9920
+ c = _rr40[1],
9921
9921
  _rr41 = rr(!1),
9922
9922
  _rr42 = _slicedToArray(_rr41, 2),
9923
- c = _rr42[0],
9924
- l = _rr42[1];
9923
+ l = _rr42[0],
9924
+ u = _rr42[1];
9925
+ if (!r) return bo.createElement(bo.Fragment, null);
9925
9926
  return bo.createElement("form", {
9926
9927
  onSubmit: function onSubmit(t) {
9927
9928
  return Tt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee17() {
9928
9929
  return _regeneratorRuntime().wrap(function _callee17$(_context17) {
9929
9930
  while (1) switch (_context17.prev = _context17.next) {
9930
9931
  case 0:
9931
- t.preventDefault(), o.match(Rt) ? (s(""), l(!0), tn(n).searchManager.searchUser(o).then(function (_ref74) {
9932
+ t.preventDefault(), i.match(Rt) ? (c(""), u(!0), tn(n).searchManager.searchUser(i).then(function (_ref74) {
9932
9933
  var t = _ref74.userType;
9933
9934
  e({
9934
9935
  type: "update_password_state",
9935
9936
  passwordState: {
9936
- email: o,
9937
+ email: i,
9937
9938
  type: t
9938
9939
  }
9939
9940
  }), e({
@@ -9942,13 +9943,13 @@ var Rl = _defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.
9942
9943
  }), tn(n).networkClient.logEvent({
9943
9944
  name: "email_sent",
9944
9945
  details: {
9945
- email: o,
9946
+ email: i,
9946
9947
  type: Vs.ResetPassword
9947
9948
  }
9948
9949
  });
9949
9950
  })["catch"](function (e) {
9950
- l(!1), s(e.message);
9951
- })) : s("Invalid email address");
9951
+ u(!1), c(e.message);
9952
+ })) : c("Invalid email address");
9952
9953
  case 1:
9953
9954
  case "end":
9954
9955
  return _context17.stop();
@@ -9963,14 +9964,14 @@ var Rl = _defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.
9963
9964
  direction: "column",
9964
9965
  height: 52
9965
9966
  }, bo.createElement(Bl, {
9966
- email: o,
9967
- setEmail: i,
9968
- hasPasskeys: r
9967
+ email: i,
9968
+ setEmail: a,
9969
+ hasPasskeys: o
9969
9970
  }), bo.createElement(Ts, {
9970
9971
  size: "helper",
9971
9972
  color: "error"
9972
- }, a)), bo.createElement(jl, {
9973
- isSubmitting: c,
9973
+ }, s)), bo.createElement(jl, {
9974
+ isSubmitting: l,
9974
9975
  text: "Continue with email"
9975
9976
  })));
9976
9977
  },
@@ -10144,10 +10145,7 @@ var tu = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
10144
10145
  conditionalMediation: !0
10145
10146
  }),
10146
10147
  c = _Hl.promptAutofill;
10147
- if (c(), o && i) return bo.createElement(Ts, {
10148
- size: "helper"
10149
- }, "Error: Cannot use both EML and Email OTP");
10150
- a && o && (s = s.filter(function (e) {
10148
+ c(), a && o && (s = s.filter(function (e) {
10151
10149
  return e !== $l.Email;
10152
10150
  })), a && i && (s = s.filter(function (e) {
10153
10151
  return e !== exports.OTPMethods.Email;
@@ -10155,16 +10153,19 @@ var tu = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_define
10155
10153
  var _rr45 = rr(s[0]),
10156
10154
  _rr46 = _slicedToArray(_rr45, 2),
10157
10155
  l = _rr46[0],
10158
- u = _rr46[1],
10159
- d = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.Email, Fl), exports.OTPMethods.WhatsApp, function () {
10160
- return bo.createElement(Ul, {
10161
- method: exports.OTPMethods.WhatsApp
10162
- });
10163
- }), exports.OTPMethods.SMS, function () {
10164
- return bo.createElement(Ul, {
10165
- method: exports.OTPMethods.SMS
10166
- });
10167
- }), $l.Email, zl), eu.Email, Ql);
10156
+ u = _rr46[1];
10157
+ if (o && i) return bo.createElement(Ts, {
10158
+ size: "helper"
10159
+ }, "Error: Cannot use both EML and Email OTP");
10160
+ var d = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, exports.OTPMethods.Email, Fl), exports.OTPMethods.WhatsApp, function () {
10161
+ return bo.createElement(Ul, {
10162
+ method: exports.OTPMethods.WhatsApp
10163
+ });
10164
+ }), exports.OTPMethods.SMS, function () {
10165
+ return bo.createElement(Ul, {
10166
+ method: exports.OTPMethods.SMS
10167
+ });
10168
+ }), $l.Email, zl), eu.Email, Ql);
10168
10169
  return bo.createElement(bo.Fragment, null, bo.createElement(Yl, {
10169
10170
  variant: "warning"
10170
10171
  }), bo.createElement(El, {
@@ -11574,7 +11575,7 @@ var ep = function ep(_ref85) {
11574
11575
  }).then(function (e) {
11575
11576
  y(p === exports.OTPMethods.Email ? d : e.number);
11576
11577
  });
11577
- }, [p, d]);
11578
+ }, [p, d, i]);
11578
11579
  return ir(function () {
11579
11580
  6 === h.length && Tt(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
11580
11581
  var e, t;
@@ -12303,9 +12304,8 @@ var nh = function nh(e) {
12303
12304
  rh = function rh() {
12304
12305
  var e = vs(),
12305
12306
  t = _s(),
12306
- n = t.passwordOptions;
12307
- if (!n) return bo.createElement(bo.Fragment, null);
12308
- var _Cs19 = Cs(),
12307
+ n = t.passwordOptions,
12308
+ _Cs19 = Cs(),
12309
12309
  _Cs20 = _slicedToArray(_Cs19, 2),
12310
12310
  r = _Cs20[0],
12311
12311
  o = _Cs20[1],
@@ -12371,7 +12371,8 @@ var nh = function nh(e) {
12371
12371
  "invalid_email" === e.error_type && p(e.message);
12372
12372
  });
12373
12373
  });
12374
- }, []);
12374
+ }, [e.passwords]);
12375
+ if (!n) return bo.createElement(bo.Fragment, null);
12375
12376
  return bo.createElement("form", {
12376
12377
  onSubmit: function onSubmit(r) {
12377
12378
  var c, u;
@@ -12439,9 +12440,8 @@ var nh = function nh(e) {
12439
12440
  ih = function ih() {
12440
12441
  var e = vs(),
12441
12442
  t = _s(),
12442
- n = t.passwordOptions;
12443
- if (!n) return bo.createElement(bo.Fragment, null);
12444
- var _Cs21 = Cs(),
12443
+ n = t.passwordOptions,
12444
+ _Cs21 = Cs(),
12445
12445
  _Cs22 = _slicedToArray(_Cs21, 2),
12446
12446
  r = _Cs22[0],
12447
12447
  o = _Cs22[1],
@@ -12463,6 +12463,7 @@ var nh = function nh(e) {
12463
12463
  _rr92 = _slicedToArray(_rr91, 2),
12464
12464
  h = _rr92[0],
12465
12465
  f = _rr92[1];
12466
+ if (!n) return bo.createElement(bo.Fragment, null);
12466
12467
  return bo.createElement(xs, {
12467
12468
  direction: "column",
12468
12469
  gap: 36
@@ -13454,7 +13455,7 @@ var nh = function nh(e) {
13454
13455
  w(r), y(!n), "zxcvbn" === r ? (f(e), A(t.warning)) : "luds" === r && (E(t.luds_requirements.missing_characters), S(t.luds_requirements.missing_complexity), T(o));
13455
13456
  });
13456
13457
  });
13457
- }, []);
13458
+ }, [e.passwords]);
13458
13459
  ir(function () {
13459
13460
  var e;
13460
13461
  var t = null !== (e = new URLSearchParams(window.location.search).get("stytch_token_type")) && void 0 !== e ? e : "";
@@ -13961,7 +13962,7 @@ var Bh = cs(xs)(_templateObject33 || (_templateObject33 = _taggedTemplateLiteral
13961
13962
  })["catch"](function (e) {
13962
13963
  console.log(e);
13963
13964
  });
13964
- }, []);
13965
+ }, [e.user]);
13965
13966
  return bo.createElement(xs, {
13966
13967
  direction: "column",
13967
13968
  gap: 18,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stytch/vanilla-js",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Stytch's official Javascript Client Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -30,7 +30,7 @@
30
30
  "user"
31
31
  ],
32
32
  "dependencies": {
33
- "@stytch/core": "2.2.0",
33
+ "@stytch/core": "2.3.0",
34
34
  "@types/google-one-tap": "^1.2.0"
35
35
  },
36
36
  "devDependencies": {