@stytch/vanilla-js 3.0.2 → 3.0.3

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,16 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 965680c: Remove PasswordEMLCombinedDiscovery
8
+ - 32ed73a: Resolved a critical severity vulnerability with the @babel/traverse dependency
9
+ - Updated dependencies [ecef75b]
10
+ - Updated dependencies [2b9ed9c]
11
+ - Updated dependencies [32ed73a]
12
+ - @stytch/core@1.2.3
13
+
3
14
  ## 3.0.2
4
15
 
5
16
  ### Patch Changes
@@ -1692,29 +1692,31 @@ var re = Promise.resolve({
1692
1692
  i = n.organization_slug,
1693
1693
  a = n.login_redirect_url,
1694
1694
  s = n.signup_redirect_url,
1695
- l = n.custom_scopes;
1695
+ l = n.custom_scopes,
1696
+ c = n.provider_params;
1696
1697
  return w(t, void 0, void 0, o().mark(function t() {
1697
- var n, c, u, d, f;
1698
+ var n, u, d, f, p, h;
1698
1699
  return o().wrap(function (t) {
1699
1700
  for (;;) switch (t.prev = t.next) {
1700
1701
  case 0:
1701
1702
  return t.next = 2, this._dynamicConfig;
1702
1703
  case 2:
1703
- return n = t.sent, c = n.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
1704
+ return n = t.sent, u = n.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
1704
1705
  case 6:
1705
- if (u = t.sent, (d = new URL("".concat(u, "/v1/b2b/public/oauth/").concat(e, "/start"))).searchParams.set("public_token", this._config.publicToken), r && "" != r && d.searchParams.set("organization_id", r), i && "" != i && d.searchParams.set("slug", i), l && (X("startOAuthFlow").isStringArray("custom_scopes", l), d.searchParams.set("custom_scopes", l.join(" "))), !c) {
1706
- t.next = 19;
1706
+ if (d = t.sent, (f = new URL("".concat(d, "/v1/b2b/public/oauth/").concat(e, "/start"))).searchParams.set("public_token", this._config.publicToken), r && "" != r && f.searchParams.set("organization_id", r), i && "" != i && f.searchParams.set("slug", i), l && (X("startOAuthFlow").isStringArray("custom_scopes", l), f.searchParams.set("custom_scopes", l.join(" "))), c) for (p in X("startOAuthFlow").isOptionalObject("provider_params", c), c) f.searchParams.set("provider_" + p, c[p]);
1707
+ if (!u) {
1708
+ t.next = 20;
1707
1709
  break;
1708
1710
  }
1709
- return t.next = 15, this._pkceManager.startPKCETransaction();
1710
- case 15:
1711
- f = t.sent, d.searchParams.set("pkce_code_challenge", f.code_challenge), t.next = 20;
1711
+ return t.next = 16, this._pkceManager.startPKCETransaction();
1712
+ case 16:
1713
+ h = t.sent, f.searchParams.set("pkce_code_challenge", h.code_challenge), t.next = 21;
1712
1714
  break;
1713
- case 19:
1714
- this._pkceManager.clearPKPair();
1715
1715
  case 20:
1716
- a && d.searchParams.set("login_redirect_url", a), s && d.searchParams.set("signup_redirect_url", s), window.location.href = d.toString();
1717
- case 23:
1716
+ this._pkceManager.clearPKPair();
1717
+ case 21:
1718
+ a && f.searchParams.set("login_redirect_url", a), s && f.searchParams.set("signup_redirect_url", s), window.location.href = f.toString();
1719
+ case 24:
1718
1720
  case "end":
1719
1721
  return t.stop();
1720
1722
  }
@@ -1728,29 +1730,31 @@ var re = Promise.resolve({
1728
1730
  var t = this;
1729
1731
  return function (n) {
1730
1732
  var r = n.discovery_redirect_url,
1731
- i = n.custom_scopes;
1733
+ i = n.custom_scopes,
1734
+ a = n.provider_params;
1732
1735
  return w(t, void 0, void 0, o().mark(function t() {
1733
- var n, a, s, l, c;
1736
+ var n, s, l, c, u, d;
1734
1737
  return o().wrap(function (t) {
1735
1738
  for (;;) switch (t.prev = t.next) {
1736
1739
  case 0:
1737
1740
  return t.next = 2, this._dynamicConfig;
1738
1741
  case 2:
1739
- return n = t.sent, a = n.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
1742
+ return n = t.sent, s = n.pkceRequiredForOAuth, t.next = 6, this.getBaseApiUrl();
1740
1743
  case 6:
1741
- if (s = t.sent, (l = new URL("".concat(s, "/v1/b2b/public/oauth/").concat(e, "/discovery/start"))).searchParams.set("public_token", this._config.publicToken), i && (X("startOAuthFlow").isStringArray("custom_scopes", i), l.searchParams.set("custom_scopes", i.join(" "))), !a) {
1742
- t.next = 17;
1744
+ if (l = t.sent, (c = new URL("".concat(l, "/v1/b2b/public/oauth/").concat(e, "/discovery/start"))).searchParams.set("public_token", this._config.publicToken), i && (X("startOAuthFlow").isStringArray("custom_scopes", i), c.searchParams.set("custom_scopes", i.join(" "))), a) for (u in X("startOAuthFlow").isOptionalObject("provider_params", a), a) c.searchParams.set("provider_" + u, a[u]);
1745
+ if (!s) {
1746
+ t.next = 18;
1743
1747
  break;
1744
1748
  }
1745
- return t.next = 13, this._pkceManager.startPKCETransaction();
1746
- case 13:
1747
- c = t.sent, l.searchParams.set("pkce_code_challenge", c.code_challenge), t.next = 18;
1749
+ return t.next = 14, this._pkceManager.startPKCETransaction();
1750
+ case 14:
1751
+ d = t.sent, c.searchParams.set("pkce_code_challenge", d.code_challenge), t.next = 19;
1748
1752
  break;
1749
- case 17:
1750
- this._pkceManager.clearPKPair();
1751
1753
  case 18:
1752
- r && l.searchParams.set("discovery_redirect_url", r), window.location.href = l.toString();
1753
- case 20:
1754
+ this._pkceManager.clearPKPair();
1755
+ case 19:
1756
+ r && c.searchParams.set("discovery_redirect_url", r), window.location.href = c.toString();
1757
+ case 21:
1754
1758
  case "end":
1755
1759
  return t.stop();
1756
1760
  }
@@ -2886,7 +2890,7 @@ var Re = /*#__PURE__*/function () {
2886
2890
  },
2887
2891
  sdk: {
2888
2892
  identifier: "Stytch.js Javascript SDK",
2889
- version: "3.0.2"
2893
+ version: "3.0.3"
2890
2894
  }
2891
2895
  });
2892
2896
  }
@@ -13951,7 +13955,7 @@ var Jy = function Jy() {
13951
13955
  };
13952
13956
  var eA;
13953
13957
  !function (e) {
13954
- e.MagicLinkEmailForm = "MagicLinkEmailForm", e.MagicLinkEmailDiscoveryForm = "MagicLinkEmailDiscoveryForm", e.OAuthButtons = "OAuthButtons", e.SSOButtons = "SSOButtons", e.PasswordsEmailForm = "PasswordsEmailForm", e.PasswordEMLCombined = "PasswordEMLCombined", e.PasswordEMLCombinedDiscovery = "PasswordEMLCombinedDiscovery", e.Divider = "Divider";
13958
+ e.MagicLinkEmailForm = "MagicLinkEmailForm", e.MagicLinkEmailDiscoveryForm = "MagicLinkEmailDiscoveryForm", e.OAuthButtons = "OAuthButtons", e.SSOButtons = "SSOButtons", e.PasswordsEmailForm = "PasswordsEmailForm", e.PasswordEMLCombined = "PasswordEMLCombined", e.Divider = "Divider";
13955
13959
  }(eA || (eA = {}));
13956
13960
  var tA = _o(Yg)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n > * + * {\n margin-top: 24px;\n }\n"]))),
13957
13961
  nA = _o.img(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n max-height: 50px;\n max-width: 100px;\n"]))),
@@ -14002,16 +14006,6 @@ var tA = _o(Yg)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
14002
14006
  }), Mt.createElement(Xy, {
14003
14007
  key: "password"
14004
14008
  }));
14005
- case eA.PasswordEMLCombinedDiscovery:
14006
- return Mt.createElement(Yg, {
14007
- key: "eml_password_discovery",
14008
- direction: "column",
14009
- gap: 12
14010
- }, Mt.createElement(xy, {
14011
- key: "magic_link"
14012
- }), Mt.createElement(Xy, {
14013
- key: "password"
14014
- }));
14015
14009
  case eA.Divider:
14016
14010
  return Mt.createElement(Ry, {
14017
14011
  key: "divider"
@@ -14057,7 +14051,7 @@ var tA = _o(Yg)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral
14057
14051
  var _n10 = e.indexOf(Zh.passwords),
14058
14052
  _o8 = e.indexOf(Zh.emailMagicLinks),
14059
14053
  _i6 = Math.min(_n10, _o8),
14060
- _a4 = t === Xh.Organization ? eA.PasswordEMLCombined : eA.PasswordEMLCombinedDiscovery;
14054
+ _a4 = t === Xh.Organization ? eA.PasswordEMLCombined : eA.MagicLinkEmailDiscoveryForm;
14061
14055
  r.splice(_i6, 0, _a4);
14062
14056
  }
14063
14057
  var o = r.includes(eA.OAuthButtons) || r.includes(eA.SSOButtons),