@okta/okta-auth-js 6.2.0 → 6.3.2

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 (134) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/cjs/AuthStateManager.js +9 -3
  3. package/cjs/AuthStateManager.js.map +1 -1
  4. package/cjs/OktaUserAgent.js +2 -2
  5. package/cjs/PromiseQueue.js +9 -2
  6. package/cjs/PromiseQueue.js.map +1 -1
  7. package/cjs/ServiceManager.js +3 -3
  8. package/cjs/ServiceManager.js.map +1 -1
  9. package/cjs/TransactionManager.js +11 -5
  10. package/cjs/TransactionManager.js.map +1 -1
  11. package/cjs/browser/browserStorage.js +19 -18
  12. package/cjs/browser/browserStorage.js.map +1 -1
  13. package/cjs/idx/authenticator/Authenticator.js.map +1 -1
  14. package/cjs/idx/authenticator/OktaPassword.js +12 -3
  15. package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
  16. package/cjs/idx/authenticator/OktaVerifyTotp.js +9 -1
  17. package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -1
  18. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +14 -1
  19. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
  20. package/cjs/idx/authenticator/SecurityQuestionVerification.js +9 -1
  21. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  22. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +13 -3
  23. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  24. package/cjs/idx/authenticator/WebauthnEnrollment.js +5 -0
  25. package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -1
  26. package/cjs/idx/authenticator/WebauthnVerification.js +5 -0
  27. package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -1
  28. package/cjs/idx/authenticator/util.js +64 -0
  29. package/cjs/idx/authenticator/util.js.map +1 -0
  30. package/cjs/idx/idx-js/index.js +0 -122
  31. package/cjs/idx/idx-js/index.js.map +1 -1
  32. package/cjs/idx/idx-js/introspect.js +10 -6
  33. package/cjs/idx/idx-js/introspect.js.map +1 -1
  34. package/cjs/idx/idx-js/v1/generateIdxAction.js +17 -23
  35. package/cjs/idx/idx-js/v1/generateIdxAction.js.map +1 -1
  36. package/cjs/idx/idx-js/v1/makeIdxState.js +5 -4
  37. package/cjs/idx/idx-js/v1/makeIdxState.js.map +1 -1
  38. package/cjs/idx/introspect.js +13 -3
  39. package/cjs/idx/introspect.js.map +1 -1
  40. package/cjs/idx/proceed.js +14 -11
  41. package/cjs/idx/proceed.js.map +1 -1
  42. package/cjs/idx/remediate.js +68 -77
  43. package/cjs/idx/remediate.js.map +1 -1
  44. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +6 -2
  45. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  46. package/cjs/idx/remediators/AuthenticatorVerificationData.js +23 -19
  47. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  48. package/cjs/idx/remediators/Base/AuthenticatorData.js +22 -14
  49. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  50. package/cjs/idx/remediators/Base/Remediator.js +85 -85
  51. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  52. package/cjs/idx/remediators/Base/SelectAuthenticator.js +24 -15
  53. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  54. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +15 -4
  55. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  56. package/cjs/idx/remediators/ChallengePoll.js +8 -1
  57. package/cjs/idx/remediators/ChallengePoll.js.map +1 -1
  58. package/cjs/idx/remediators/EnrollPoll.js +1 -1
  59. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  60. package/cjs/idx/remediators/EnrollProfile.js +15 -9
  61. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  62. package/cjs/idx/remediators/EnrollmentChannelData.js +0 -8
  63. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -1
  64. package/cjs/idx/remediators/Identify.js +12 -5
  65. package/cjs/idx/remediators/Identify.js.map +1 -1
  66. package/cjs/idx/remediators/ReEnrollAuthenticator.js +9 -8
  67. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  68. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +4 -3
  69. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  70. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +0 -1
  71. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -1
  72. package/cjs/idx/remediators/Skip.js +1 -8
  73. package/cjs/idx/remediators/Skip.js.map +1 -1
  74. package/cjs/idx/remediators/util.js.map +1 -1
  75. package/cjs/idx/run.js +267 -198
  76. package/cjs/idx/run.js.map +1 -1
  77. package/cjs/idx/types/idx-js.js.map +1 -1
  78. package/cjs/idx/types/index.js +37 -0
  79. package/cjs/idx/types/index.js.map +1 -1
  80. package/cjs/idx/util.js +198 -0
  81. package/cjs/idx/util.js.map +1 -0
  82. package/cjs/options/browser.js +11 -6
  83. package/cjs/options/browser.js.map +1 -1
  84. package/cjs/options/index.js +1 -1
  85. package/cjs/options/index.js.map +1 -1
  86. package/cjs/options/node.js +5 -6
  87. package/cjs/options/node.js.map +1 -1
  88. package/dist/okta-auth-js.min.js +1 -1
  89. package/dist/okta-auth-js.min.js.map +1 -1
  90. package/dist/okta-auth-js.umd.js +1 -1
  91. package/dist/okta-auth-js.umd.js.map +1 -1
  92. package/esm/esm.browser.js +1060 -775
  93. package/esm/esm.browser.js.map +1 -1
  94. package/esm/esm.node.mjs +1057 -775
  95. package/esm/esm.node.mjs.map +1 -1
  96. package/lib/AuthStateManager.d.ts +2 -0
  97. package/lib/PromiseQueue.d.ts +6 -2
  98. package/lib/TransactionManager.d.ts +3 -4
  99. package/lib/idx/authenticator/Authenticator.d.ts +1 -1
  100. package/lib/idx/authenticator/OktaPassword.d.ts +2 -1
  101. package/lib/idx/authenticator/OktaVerifyTotp.d.ts +1 -1
  102. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +3 -5
  103. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +1 -1
  104. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +2 -1
  105. package/lib/idx/authenticator/WebauthnEnrollment.d.ts +1 -1
  106. package/lib/idx/authenticator/WebauthnVerification.d.ts +1 -1
  107. package/lib/idx/authenticator/util.d.ts +4 -0
  108. package/lib/idx/idx-js/index.d.ts +1 -17
  109. package/lib/idx/idx-js/introspect.d.ts +2 -1
  110. package/lib/idx/idx-js/v1/generateIdxAction.d.ts +1 -1
  111. package/lib/idx/idx-js/v1/makeIdxState.d.ts +2 -2
  112. package/lib/idx/proceed.d.ts +1 -3
  113. package/lib/idx/remediate.d.ts +2 -2
  114. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -0
  115. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +0 -3
  116. package/lib/idx/remediators/Base/Remediator.d.ts +5 -4
  117. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +7 -9
  118. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -4
  119. package/lib/idx/remediators/ChallengePoll.d.ts +1 -0
  120. package/lib/idx/remediators/EnrollProfile.d.ts +0 -3
  121. package/lib/idx/remediators/EnrollmentChannelData.d.ts +0 -4
  122. package/lib/idx/remediators/Identify.d.ts +3 -5
  123. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -5
  124. package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +2 -1
  125. package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +1 -2
  126. package/lib/idx/remediators/Skip.d.ts +0 -3
  127. package/lib/idx/types/idx-js.d.ts +5 -1
  128. package/lib/idx/types/index.d.ts +7 -3
  129. package/lib/idx/util.d.ts +11 -0
  130. package/lib/options/browser.d.ts +2 -2
  131. package/lib/options/node.d.ts +2 -2
  132. package/lib/types/Storage.d.ts +7 -5
  133. package/lib/types/api.d.ts +1 -3
  134. package/package.json +7 -6
@@ -49,13 +49,13 @@ import { BroadcastChannel, createLeaderElection } from 'broadcast-channel';
49
49
  import PCancelable from 'p-cancelable';
50
50
  import _entriesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/entries';
51
51
  import crossFetch from 'cross-fetch';
52
- import _URL from '@babel/runtime-corejs3/core-js-stable/url';
53
52
  import _Object$fromEntries from '@babel/runtime-corejs3/core-js-stable/object/from-entries';
54
53
  import { JSONPath } from 'jsonpath-plus';
55
54
  import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
56
- import _get from '@babel/runtime-corejs3/helpers/get';
57
55
  import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
56
+ import _get from '@babel/runtime-corejs3/helpers/get';
58
57
  import _Number$isInteger from '@babel/runtime-corejs3/core-js-stable/number/is-integer';
58
+ import _URL2 from '@babel/runtime-corejs3/core-js-stable/url';
59
59
  import Emitter from 'tiny-emitter';
60
60
 
61
61
  function _createSuper$x(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$x(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -1711,6 +1711,9 @@ var IdxFeature;
1711
1711
  IdxFeature["SOCIAL_IDP"] = "redirect-idp";
1712
1712
  IdxFeature["ACCOUNT_UNLOCK"] = "unlock-account";
1713
1713
  })(IdxFeature || (IdxFeature = {}));
1714
+ function isAuthenticator(obj) {
1715
+ return obj && (obj.key || obj.id);
1716
+ }
1714
1717
 
1715
1718
  function isToken(obj) {
1716
1719
  if (obj && (obj.accessToken || obj.idToken || obj.refreshToken) && Array.isArray(obj.scopes)) {
@@ -2649,16 +2652,16 @@ var storageUtil = {
2649
2652
  },
2650
2653
  browserHasLocalStorage: function browserHasLocalStorage() {
2651
2654
  try {
2652
- var storage = storageUtil.getLocalStorage();
2653
- return storageUtil.testStorage(storage);
2655
+ var storage = this.getLocalStorage();
2656
+ return this.testStorage(storage);
2654
2657
  } catch (e) {
2655
2658
  return false;
2656
2659
  }
2657
2660
  },
2658
2661
  browserHasSessionStorage: function browserHasSessionStorage() {
2659
2662
  try {
2660
- var storage = storageUtil.getSessionStorage();
2661
- return storageUtil.testStorage(storage);
2663
+ var storage = this.getSessionStorage();
2664
+ return this.testStorage(storage);
2662
2665
  } catch (e) {
2663
2666
  return false;
2664
2667
  }
@@ -2667,10 +2670,10 @@ var storageUtil = {
2667
2670
  var supported = false;
2668
2671
  switch (storageType) {
2669
2672
  case 'sessionStorage':
2670
- supported = storageUtil.browserHasSessionStorage();
2673
+ supported = this.browserHasSessionStorage();
2671
2674
  break;
2672
2675
  case 'localStorage':
2673
- supported = storageUtil.browserHasLocalStorage();
2676
+ supported = this.browserHasLocalStorage();
2674
2677
  break;
2675
2678
  case 'cookie':
2676
2679
  case 'memory':
@@ -2686,16 +2689,16 @@ var storageUtil = {
2686
2689
  var storageProvider;
2687
2690
  switch (storageType) {
2688
2691
  case 'sessionStorage':
2689
- storageProvider = storageUtil.getSessionStorage();
2692
+ storageProvider = this.getSessionStorage();
2690
2693
  break;
2691
2694
  case 'localStorage':
2692
- storageProvider = storageUtil.getLocalStorage();
2695
+ storageProvider = this.getLocalStorage();
2693
2696
  break;
2694
2697
  case 'cookie':
2695
- storageProvider = storageUtil.getCookieStorage(options);
2698
+ storageProvider = this.getCookieStorage(options);
2696
2699
  break;
2697
2700
  case 'memory':
2698
- storageProvider = storageUtil.getInMemoryStorage();
2701
+ storageProvider = this.getInMemoryStorage();
2699
2702
  break;
2700
2703
  default:
2701
2704
  throw new AuthSdkError("Unrecognized storage option: ".concat(storageType));
@@ -2712,11 +2715,11 @@ var storageUtil = {
2712
2715
  if (!nextType) {
2713
2716
  return curType;
2714
2717
  }
2715
- if (storageUtil.testStorageType(curType)) {
2718
+ if (this.testStorageType(curType)) {
2716
2719
  return curType;
2717
2720
  }
2718
2721
  warn(_concatInstanceProperty(_context = "This browser doesn't support ".concat(curType, ". Switching to ")).call(_context, nextType, "."));
2719
- return storageUtil.findStorageType(types);
2722
+ return this.findStorageType(types);
2720
2723
  },
2721
2724
  getLocalStorage: function getLocalStorage() {
2722
2725
  return localStorage;
@@ -2725,6 +2728,7 @@ var storageUtil = {
2725
2728
  return sessionStorage;
2726
2729
  },
2727
2730
  getCookieStorage: function getCookieStorage(options) {
2731
+ var _this = this;
2728
2732
  var secure = options.secure;
2729
2733
  var sameSite = options.sameSite;
2730
2734
  var sessionCookie = options.sessionCookie;
@@ -2732,17 +2736,17 @@ var storageUtil = {
2732
2736
  throw new AuthSdkError('getCookieStorage: "secure" and "sameSite" options must be provided');
2733
2737
  }
2734
2738
  var storage = {
2735
- getItem: storageUtil.storage.get,
2739
+ getItem: this.storage.get,
2736
2740
  setItem: function setItem(key, value) {
2737
2741
  var expiresAt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '2200-01-01T00:00:00.000Z';
2738
2742
  expiresAt = sessionCookie ? null : expiresAt;
2739
- storageUtil.storage.set(key, value, expiresAt, {
2743
+ _this.storage.set(key, value, expiresAt, {
2740
2744
  secure: secure,
2741
2745
  sameSite: sameSite
2742
2746
  });
2743
2747
  },
2744
2748
  removeItem: function removeItem(key) {
2745
- storageUtil.storage.delete(key);
2749
+ _this.storage.delete(key);
2746
2750
  }
2747
2751
  };
2748
2752
  if (!options.useSeparateCookies) {
@@ -2782,13 +2786,13 @@ var storageUtil = {
2782
2786
  },
2783
2787
  inMemoryStore: {},
2784
2788
  getInMemoryStorage: function getInMemoryStorage() {
2785
- var _this = this;
2789
+ var _this2 = this;
2786
2790
  return {
2787
2791
  getItem: function getItem(key) {
2788
- return _this.inMemoryStore[key];
2792
+ return _this2.inMemoryStore[key];
2789
2793
  },
2790
2794
  setItem: function setItem(key, value) {
2791
- _this.inMemoryStore[key] = value;
2795
+ _this2.inMemoryStore[key] = value;
2792
2796
  }
2793
2797
  };
2794
2798
  },
@@ -2818,7 +2822,7 @@ var storageUtil = {
2818
2822
  cookieOptions.expires = new Date(expiresAt);
2819
2823
  }
2820
2824
  Cookies.set(name, value, cookieOptions);
2821
- return storageUtil.storage.get(name);
2825
+ return this.get(name);
2822
2826
  },
2823
2827
  get: function get(name) {
2824
2828
  if (!arguments.length) {
@@ -3458,9 +3462,9 @@ var SyncStorageService = function () {
3458
3462
  return SyncStorageService;
3459
3463
  }();
3460
3464
 
3461
- function _createForOfIteratorHelper$6(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3462
- function _unsupportedIterableToArray$6(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$6(o, minLen); var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen); }
3463
- function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
3465
+ function _createForOfIteratorHelper$7(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$7(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3466
+ function _unsupportedIterableToArray$7(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$7(o, minLen); var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen); }
3467
+ function _arrayLikeToArray$7(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
3464
3468
  var ServiceManager = function () {
3465
3469
  function ServiceManager(sdk) {
3466
3470
  var _this = this;
@@ -3545,7 +3549,7 @@ var ServiceManager = function () {
3545
3549
  key: "startServices",
3546
3550
  value: function startServices() {
3547
3551
  var _context2;
3548
- var _iterator = _createForOfIteratorHelper$6(_valuesInstanceProperty(_context2 = this.services).call(_context2)),
3552
+ var _iterator = _createForOfIteratorHelper$7(_valuesInstanceProperty(_context2 = this.services).call(_context2)),
3549
3553
  _step;
3550
3554
  try {
3551
3555
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -3565,7 +3569,7 @@ var ServiceManager = function () {
3565
3569
  key: "stopServices",
3566
3570
  value: function stopServices() {
3567
3571
  var _context3;
3568
- var _iterator2 = _createForOfIteratorHelper$6(_valuesInstanceProperty(_context3 = this.services).call(_context3)),
3572
+ var _iterator2 = _createForOfIteratorHelper$7(_valuesInstanceProperty(_context3 = this.services).call(_context3)),
3569
3573
  _step2;
3570
3574
  try {
3571
3575
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -3577,7 +3581,6 @@ var ServiceManager = function () {
3577
3581
  } finally {
3578
3582
  _iterator2.f();
3579
3583
  }
3580
- this.services = new _Map();
3581
3584
  }
3582
3585
  }, {
3583
3586
  key: "startElector",
@@ -3598,10 +3601,12 @@ var ServiceManager = function () {
3598
3601
  }, {
3599
3602
  key: "stopElector",
3600
3603
  value: function stopElector() {
3601
- var _a;
3604
+ var _a, _b;
3602
3605
  if (this.elector) {
3603
3606
  (_a = this.elector) === null || _a === void 0 ? void 0 : _a.die();
3604
3607
  this.elector = undefined;
3608
+ (_b = this.channel) === null || _b === void 0 ? void 0 : _b.close();
3609
+ this.channel = undefined;
3605
3610
  }
3606
3611
  }
3607
3612
  }, {
@@ -3638,9 +3643,13 @@ ServiceManager.defaultOptions = {
3638
3643
 
3639
3644
  var PromiseQueue = function () {
3640
3645
  function PromiseQueue() {
3646
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
3647
+ quiet: false
3648
+ };
3641
3649
  _classCallCheck(this, PromiseQueue);
3642
3650
  this.queue = [];
3643
3651
  this.running = false;
3652
+ this.options = options;
3644
3653
  }
3645
3654
  _createClass(PromiseQueue, [{
3646
3655
  key: "push",
@@ -3651,7 +3660,9 @@ var PromiseQueue = function () {
3651
3660
  }
3652
3661
  return new _Promise(function (resolve, reject) {
3653
3662
  if (_this.queue.length > 0) {
3654
- warn('Async method is being called but another async method is already running. ' + 'The new method will be delayed until the previous method completes.');
3663
+ if (_this.options.quiet !== false) {
3664
+ warn('Async method is being called but another async method is already running. ' + 'The new method will be delayed until the previous method completes.');
3665
+ }
3655
3666
  }
3656
3667
  _this.queue.push({
3657
3668
  method: method,
@@ -3764,6 +3775,9 @@ var AuthStateManager = function () {
3764
3775
  this._authState = INITIAL_AUTH_STATE;
3765
3776
  this._logOptions = {};
3766
3777
  this._prevAuthState = null;
3778
+ this._transformQueue = new PromiseQueue({
3779
+ quiet: true
3780
+ });
3767
3781
  sdk.tokenManager.on(EVENT_ADDED, function (key, token) {
3768
3782
  _this._setLogOptions({
3769
3783
  event: EVENT_ADDED,
@@ -3882,7 +3896,7 @@ var AuthStateManager = function () {
3882
3896
  refreshToken: refreshToken,
3883
3897
  isAuthenticated: !!(accessToken && idToken)
3884
3898
  };
3885
- var promise = transformAuthState ? transformAuthState(_this2._sdk, authState) : _Promise.resolve(authState);
3899
+ var promise = transformAuthState ? _this2._transformQueue.push(transformAuthState, null, _this2._sdk, authState) : _Promise.resolve(authState);
3886
3900
  promise.then(function (authState) {
3887
3901
  return emitAndResolve(authState);
3888
3902
  }).catch(function (error) {
@@ -4415,7 +4429,9 @@ var TransactionManager = function () {
4415
4429
  }
4416
4430
  }, {
4417
4431
  key: "saveIdxResponse",
4418
- value: function saveIdxResponse(idxResponse) {
4432
+ value: function saveIdxResponse(_ref) {
4433
+ var rawIdxResponse = _ref.rawIdxResponse,
4434
+ requestDidSucceed = _ref.requestDidSucceed;
4419
4435
  if (!this.saveLastResponse) {
4420
4436
  return;
4421
4437
  }
@@ -4423,7 +4439,10 @@ var TransactionManager = function () {
4423
4439
  if (!storage) {
4424
4440
  return;
4425
4441
  }
4426
- storage.setStorage(idxResponse);
4442
+ storage.setStorage({
4443
+ rawIdxResponse: rawIdxResponse,
4444
+ requestDidSucceed: requestDidSucceed
4445
+ });
4427
4446
  }
4428
4447
  }, {
4429
4448
  key: "loadIdxResponse",
@@ -4435,11 +4454,11 @@ var TransactionManager = function () {
4435
4454
  if (!storage) {
4436
4455
  return null;
4437
4456
  }
4438
- var idxResponse = storage.getStorage();
4439
- if (!isRawIdxResponse(idxResponse)) {
4457
+ var storedValue = storage.getStorage();
4458
+ if (!storedValue || !isRawIdxResponse(storedValue.rawIdxResponse)) {
4440
4459
  return null;
4441
4460
  }
4442
- return idxResponse;
4461
+ return storedValue;
4443
4462
  }
4444
4463
  }, {
4445
4464
  key: "clearIdxResponse",
@@ -4473,9 +4492,9 @@ function assertValidConfig(args) {
4473
4492
  }
4474
4493
  }
4475
4494
 
4476
- function _createForOfIteratorHelper$5(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4477
- function _unsupportedIterableToArray$5(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
4478
- function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4495
+ function _createForOfIteratorHelper$6(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4496
+ function _unsupportedIterableToArray$6(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$6(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen); }
4497
+ function _arrayLikeToArray$6(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4479
4498
  function readData(response) {
4480
4499
  var _context;
4481
4500
  if (response.headers.get('Content-Type') &&
@@ -4495,7 +4514,7 @@ function formatResult(status, data, response) {
4495
4514
  var _context2;
4496
4515
  var isObject = _typeof(data) === 'object';
4497
4516
  var headers = {};
4498
- var _iterator = _createForOfIteratorHelper$5(_entriesInstanceProperty(_context2 = response.headers).call(_context2)),
4517
+ var _iterator = _createForOfIteratorHelper$6(_entriesInstanceProperty(_context2 = response.headers).call(_context2)),
4499
4518
  _step;
4500
4519
  try {
4501
4520
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -4550,6 +4569,12 @@ function fetchRequest(method, url, args) {
4550
4569
  });
4551
4570
  }
4552
4571
 
4572
+ function getStorage() {
4573
+ var storageUtil$1 = _Object$assign({}, storageUtil, {
4574
+ inMemoryStore: {}
4575
+ });
4576
+ return storageUtil$1;
4577
+ }
4553
4578
  var STORAGE_MANAGER_OPTIONS = {
4554
4579
  token: {
4555
4580
  storageTypes: ['localStorage', 'sessionStorage', 'cookie']
@@ -4592,7 +4617,7 @@ function getDefaultOptions() {
4592
4617
  var options = {
4593
4618
  devMode: false,
4594
4619
  httpRequestClient: fetchRequest,
4595
- storageUtil: storageUtil,
4620
+ storageUtil: getStorage(),
4596
4621
  storageManager: STORAGE_MANAGER_OPTIONS,
4597
4622
  transactionManager: {
4598
4623
  enableSharedStorage: enableSharedStorage
@@ -4706,9 +4731,9 @@ var request = function () {
4706
4731
  };
4707
4732
  }();
4708
4733
 
4709
- function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4710
- function _unsupportedIterableToArray$4(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
4711
- function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4734
+ function _createForOfIteratorHelper$5(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
4735
+ function _unsupportedIterableToArray$5(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
4736
+ function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
4712
4737
  var isFieldMutable = function isFieldMutable(field) {
4713
4738
  return field.mutable !== false;
4714
4739
  };
@@ -4725,7 +4750,7 @@ var divideSingleActionParamsByMutability = function divideSingleActionParamsByMu
4725
4750
  immutableParamsForAction: immutableParamsForAction
4726
4751
  };
4727
4752
  }
4728
- var _iterator = _createForOfIteratorHelper$4(action.value),
4753
+ var _iterator = _createForOfIteratorHelper$5(action.value),
4729
4754
  _step;
4730
4755
  try {
4731
4756
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -4755,7 +4780,7 @@ var divideActionParamsByMutability = function divideActionParamsByMutability(act
4755
4780
  var neededParams = [];
4756
4781
  var defaultParams = {};
4757
4782
  var immutableParams = {};
4758
- var _iterator2 = _createForOfIteratorHelper$4(actionList),
4783
+ var _iterator2 = _createForOfIteratorHelper$5(actionList),
4759
4784
  _step2;
4760
4785
  try {
4761
4786
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -4790,7 +4815,7 @@ var generateDirectFetch = function generateDirectFetch(_ref) {
4790
4815
  var target = actionDefinition.href;
4791
4816
  return function () {
4792
4817
  var _ref2 = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(params) {
4793
- var headers, body, credentials;
4818
+ var headers, body, credentials, response, responseJSON, requestDidSucceed, idxResponse;
4794
4819
  return _regeneratorRuntime.wrap(function _callee$(_context) {
4795
4820
  while (1) {
4796
4821
  switch (_context.prev = _context.next) {
@@ -4801,29 +4826,32 @@ var generateDirectFetch = function generateDirectFetch(_ref) {
4801
4826
  };
4802
4827
  body = _JSON$stringify(_Object$assign(_Object$assign(_Object$assign({}, defaultParamsForAction), params), immutableParamsForAction));
4803
4828
  credentials = toPersist && toPersist.withCredentials === false ? 'omit' : 'include';
4804
- return _context.abrupt("return", request(target, {
4829
+ _context.next = 5;
4830
+ return request(target, {
4805
4831
  method: actionDefinition.method,
4806
4832
  headers: headers,
4807
4833
  body: body,
4808
4834
  credentials: credentials
4809
- }).then(function (response) {
4810
- var respJson = response.json();
4811
- if (response.ok) {
4812
- return respJson;
4813
- } else if (response.status === 401 && response.headers.get('WWW-Authenticate') === 'Oktadevicejwt realm="Okta Device"') {
4814
- return respJson.then(function (err) {
4815
- var ms = makeIdxState$1(err, toPersist);
4816
- ms.stepUp = true;
4817
- return _Promise.reject(ms);
4818
- });
4819
- }
4820
- return respJson.then(function (err) {
4821
- return _Promise.reject(makeIdxState$1(err, toPersist));
4822
- });
4823
- }).then(function (idxResponse) {
4824
- return makeIdxState$1(idxResponse, toPersist);
4825
- }));
4826
- case 4:
4835
+ });
4836
+ case 5:
4837
+ response = _context.sent;
4838
+ _context.next = 8;
4839
+ return response.json();
4840
+ case 8:
4841
+ responseJSON = _context.sent;
4842
+ requestDidSucceed = response.ok;
4843
+ idxResponse = makeIdxState$1(responseJSON, toPersist, requestDidSucceed);
4844
+ if (response.status === 401 && response.headers.get('WWW-Authenticate') === 'Oktadevicejwt realm="Okta Device"') {
4845
+ idxResponse.stepUp = true;
4846
+ }
4847
+ if (requestDidSucceed) {
4848
+ _context.next = 14;
4849
+ break;
4850
+ }
4851
+ throw idxResponse;
4852
+ case 14:
4853
+ return _context.abrupt("return", idxResponse);
4854
+ case 15:
4827
4855
  case "end":
4828
4856
  return _context.stop();
4829
4857
  }
@@ -4958,9 +4986,8 @@ var parseIdxResponse = function parseIdxResponse(idxResponse) {
4958
4986
  };
4959
4987
  };
4960
4988
 
4961
- function makeIdxState$1(idxResponse, toPersist) {
4962
- var _context2;
4963
- var _a;
4989
+ function makeIdxState$1(idxResponse, toPersist, requestDidSucceed) {
4990
+ var _a, _b, _c;
4964
4991
  var rawIdxResponse = idxResponse;
4965
4992
  var _parseIdxResponse = parseIdxResponse(idxResponse, toPersist),
4966
4993
  remediations = _parseIdxResponse.remediations,
@@ -5001,7 +5028,7 @@ function makeIdxState$1(idxResponse, toPersist) {
5001
5028
  var findCode = function findCode(item) {
5002
5029
  return item.name === 'interaction_code';
5003
5030
  };
5004
- var interactionCode = (_a = rawIdxResponse.successWithInteractionCode) === null || _a === void 0 ? void 0 : _findInstanceProperty(_context2 = _a.value).call(_context2, findCode).value;
5031
+ var interactionCode = (_c = (_b = (_a = rawIdxResponse.successWithInteractionCode) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _findInstanceProperty(_b).call(_b, findCode)) === null || _c === void 0 ? void 0 : _c.value;
5005
5032
  return {
5006
5033
  proceed: proceed,
5007
5034
  neededToProceed: neededToProceed,
@@ -5009,7 +5036,8 @@ function makeIdxState$1(idxResponse, toPersist) {
5009
5036
  context: context,
5010
5037
  rawIdxState: rawIdxResponse,
5011
5038
  interactionCode: interactionCode,
5012
- toPersist: toPersist
5039
+ toPersist: toPersist,
5040
+ requestDidSucceed: requestDidSucceed
5013
5041
  };
5014
5042
  }
5015
5043
 
@@ -5040,14 +5068,9 @@ function validateVersionConfig(version) {
5040
5068
  parsersForVersion(version);
5041
5069
  }
5042
5070
 
5043
- var parseAndReject$1 = function parseAndReject(response) {
5044
- return response.json().then(function (err) {
5045
- return _Promise.reject(err);
5046
- });
5047
- };
5048
5071
  var introspect$1 = function () {
5049
5072
  var _introspect = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref) {
5050
- var withCredentials, domain, interactionHandle, stateHandle, version, target, body, headers, credentials;
5073
+ var withCredentials, domain, interactionHandle, stateHandle, version, target, body, headers, credentials, response, requestDidSucceed, rawIdxResponse;
5051
5074
  return _regeneratorRuntime.wrap(function _callee$(_context) {
5052
5075
  while (1) {
5053
5076
  switch (_context.prev = _context.next) {
@@ -5065,14 +5088,27 @@ var introspect$1 = function () {
5065
5088
  accept: "application/ion+json; okta-version=".concat(version)
5066
5089
  };
5067
5090
  credentials = withCredentials === false ? 'omit' : 'include';
5068
- return _context.abrupt("return", request(target, {
5091
+ _context.next = 8;
5092
+ return request(target, {
5069
5093
  credentials: credentials,
5070
5094
  headers: headers,
5071
5095
  body: _JSON$stringify(body)
5072
- }).then(function (response) {
5073
- return response.ok ? response.json() : parseAndReject$1(response);
5074
- }));
5075
- case 7:
5096
+ });
5097
+ case 8:
5098
+ response = _context.sent;
5099
+ requestDidSucceed = response.ok;
5100
+ _context.next = 12;
5101
+ return response.json();
5102
+ case 12:
5103
+ rawIdxResponse = _context.sent;
5104
+ if (requestDidSucceed) {
5105
+ _context.next = 15;
5106
+ break;
5107
+ }
5108
+ throw rawIdxResponse;
5109
+ case 15:
5110
+ return _context.abrupt("return", rawIdxResponse);
5111
+ case 16:
5076
5112
  case "end":
5077
5113
  return _context.stop();
5078
5114
  }
@@ -5151,131 +5187,9 @@ var interact$1 = function () {
5151
5187
  }();
5152
5188
 
5153
5189
  var LATEST_SUPPORTED_IDX_API_VERSION = '1.0.0';
5154
- var start = function () {
5155
- var _start = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(_ref) {
5156
- var withCredentials, clientId, domain, issuer, stateHandle, interactionHandle, version, redirectUri, state, scopes, codeChallenge, codeChallengeMethod, activationToken, recoveryToken, baseUrl, toPersist, interactParams, interaction_handle, _parsersForVersion, _makeIdxState, idxResponse, idxState;
5157
- return _regeneratorRuntime.wrap(function _callee$(_context) {
5158
- while (1) {
5159
- switch (_context.prev = _context.next) {
5160
- case 0:
5161
- withCredentials = _ref.withCredentials, clientId = _ref.clientId, domain = _ref.domain, issuer = _ref.issuer, stateHandle = _ref.stateHandle, interactionHandle = _ref.interactionHandle, version = _ref.version, redirectUri = _ref.redirectUri, state = _ref.state, scopes = _ref.scopes, codeChallenge = _ref.codeChallenge, codeChallengeMethod = _ref.codeChallengeMethod, activationToken = _ref.activationToken, recoveryToken = _ref.recoveryToken;
5162
- issuer = issuer === null || issuer === void 0 ? void 0 : issuer.replace(/\/+$/, '');
5163
- baseUrl = (issuer === null || issuer === void 0 ? void 0 : _indexOfInstanceProperty(issuer).call(issuer, '/oauth2')) > 0 ? issuer : issuer + '/oauth2';
5164
- toPersist = {
5165
- baseUrl: baseUrl,
5166
- clientId: clientId,
5167
- state: state,
5168
- withCredentials: withCredentials
5169
- };
5170
- if (!(!domain && !issuer)) {
5171
- _context.next = 6;
5172
- break;
5173
- }
5174
- return _context.abrupt("return", _Promise.reject({
5175
- error: 'issuer is required'
5176
- }));
5177
- case 6:
5178
- if (!(!stateHandle && !clientId)) {
5179
- _context.next = 8;
5180
- break;
5181
- }
5182
- return _context.abrupt("return", _Promise.reject({
5183
- error: 'clientId is required'
5184
- }));
5185
- case 8:
5186
- if (!(!stateHandle && !redirectUri)) {
5187
- _context.next = 10;
5188
- break;
5189
- }
5190
- return _context.abrupt("return", _Promise.reject({
5191
- error: 'redirectUri is required'
5192
- }));
5193
- case 10:
5194
- if (!(!stateHandle && !(codeChallenge && codeChallengeMethod))) {
5195
- _context.next = 12;
5196
- break;
5197
- }
5198
- return _context.abrupt("return", _Promise.reject({
5199
- error: 'PKCE params (codeChallenge, codeChallengeMethod) are required'
5200
- }));
5201
- case 12:
5202
- if (!domain) {
5203
- domain = new _URL(issuer).origin;
5204
- }
5205
- validateVersionConfig(version);
5206
- if (!(!stateHandle && !interactionHandle)) {
5207
- _context.next = 27;
5208
- break;
5209
- }
5210
- _context.prev = 15;
5211
- interactParams = {
5212
- withCredentials: withCredentials,
5213
- clientId: clientId,
5214
- baseUrl: baseUrl,
5215
- scopes: scopes,
5216
- redirectUri: redirectUri,
5217
- codeChallenge: codeChallenge,
5218
- codeChallengeMethod: codeChallengeMethod,
5219
- state: state,
5220
- activationToken: activationToken,
5221
- recoveryToken: recoveryToken
5222
- };
5223
- _context.next = 19;
5224
- return interact$1(interactParams);
5225
- case 19:
5226
- interaction_handle = _context.sent;
5227
- interactionHandle = interaction_handle;
5228
- toPersist.interactionHandle = interactionHandle;
5229
- _context.next = 27;
5230
- break;
5231
- case 24:
5232
- _context.prev = 24;
5233
- _context.t0 = _context["catch"](15);
5234
- return _context.abrupt("return", _Promise.reject({
5235
- error: _context.t0
5236
- }));
5237
- case 27:
5238
- _context.prev = 27;
5239
- _parsersForVersion = parsersForVersion(version), _makeIdxState = _parsersForVersion.makeIdxState;
5240
- _context.next = 31;
5241
- return introspect$1({
5242
- withCredentials: withCredentials,
5243
- domain: domain,
5244
- interactionHandle: interactionHandle,
5245
- stateHandle: stateHandle,
5246
- version: version
5247
- }).catch(function (err) {
5248
- return _Promise.reject({
5249
- error: 'introspect call failed',
5250
- details: _makeIdxState(err, toPersist)
5251
- });
5252
- });
5253
- case 31:
5254
- idxResponse = _context.sent;
5255
- idxState = _makeIdxState(idxResponse, toPersist);
5256
- return _context.abrupt("return", idxState);
5257
- case 36:
5258
- _context.prev = 36;
5259
- _context.t1 = _context["catch"](27);
5260
- return _context.abrupt("return", _Promise.reject({
5261
- error: _context.t1
5262
- }));
5263
- case 39:
5264
- case "end":
5265
- return _context.stop();
5266
- }
5267
- }
5268
- }, _callee, null, [[15, 24], [27, 36]]);
5269
- }));
5270
- function start(_x) {
5271
- return _start.apply(this, arguments);
5272
- }
5273
- return start;
5274
- }();
5275
- var _parsersForVersion2 = parsersForVersion(LATEST_SUPPORTED_IDX_API_VERSION),
5276
- makeIdxState = _parsersForVersion2.makeIdxState;
5190
+ var _parsersForVersion = parsersForVersion(LATEST_SUPPORTED_IDX_API_VERSION),
5191
+ makeIdxState = _parsersForVersion.makeIdxState;
5277
5192
  var idx = {
5278
- start: start,
5279
5193
  introspect: introspect$1,
5280
5194
  interact: interact$1,
5281
5195
  makeIdxState: makeIdxState,
@@ -5512,6 +5426,8 @@ function _introspect() {
5512
5426
  _introspect = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(authClient) {
5513
5427
  var options,
5514
5428
  rawIdxResponse,
5429
+ requestDidSucceed,
5430
+ savedIdxResponse,
5515
5431
  version,
5516
5432
  domain,
5517
5433
  withCredentials,
@@ -5521,47 +5437,53 @@ function _introspect() {
5521
5437
  switch (_context.prev = _context.next) {
5522
5438
  case 0:
5523
5439
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
5524
- rawIdxResponse = authClient.transactionManager.loadIdxResponse();
5440
+ savedIdxResponse = authClient.transactionManager.loadIdxResponse();
5441
+ if (savedIdxResponse) {
5442
+ rawIdxResponse = savedIdxResponse.rawIdxResponse;
5443
+ requestDidSucceed = savedIdxResponse.requestDidSucceed;
5444
+ }
5525
5445
  if (rawIdxResponse) {
5526
- _context.next = 18;
5446
+ _context.next = 21;
5527
5447
  break;
5528
5448
  }
5529
5449
  version = options.version || IDX_API_VERSION;
5530
5450
  domain = getOAuthDomain(authClient);
5531
- _context.prev = 5;
5532
- _context.next = 8;
5451
+ _context.prev = 6;
5452
+ _context.next = 9;
5533
5453
  return idx.introspect(_Object$assign(_Object$assign({
5534
5454
  domain: domain
5535
5455
  }, options), {
5536
5456
  version: version
5537
5457
  }));
5538
- case 8:
5458
+ case 9:
5539
5459
  rawIdxResponse = _context.sent;
5540
- _context.next = 18;
5460
+ requestDidSucceed = true;
5461
+ _context.next = 21;
5541
5462
  break;
5542
- case 11:
5543
- _context.prev = 11;
5544
- _context.t0 = _context["catch"](5);
5463
+ case 13:
5464
+ _context.prev = 13;
5465
+ _context.t0 = _context["catch"](6);
5545
5466
  if (!isRawIdxResponse(_context.t0)) {
5546
- _context.next = 17;
5467
+ _context.next = 20;
5547
5468
  break;
5548
5469
  }
5549
5470
  rawIdxResponse = _context.t0;
5550
- _context.next = 18;
5471
+ requestDidSucceed = false;
5472
+ _context.next = 21;
5551
5473
  break;
5552
- case 17:
5474
+ case 20:
5553
5475
  throw _context.t0;
5554
- case 18:
5476
+ case 21:
5555
5477
  withCredentials = options.withCredentials;
5556
5478
  return _context.abrupt("return", idx.makeIdxState(rawIdxResponse, {
5557
5479
  withCredentials: withCredentials
5558
- }));
5559
- case 20:
5480
+ }, requestDidSucceed));
5481
+ case 23:
5560
5482
  case "end":
5561
5483
  return _context.stop();
5562
5484
  }
5563
5485
  }
5564
- }, _callee, null, [[5, 11]]);
5486
+ }, _callee, null, [[6, 13]]);
5565
5487
  }));
5566
5488
  return _introspect.apply(this, arguments);
5567
5489
  }
@@ -5592,42 +5514,91 @@ function getAuthenticatorFromRemediation(remediation) {
5592
5514
  });
5593
5515
  }
5594
5516
 
5517
+ function _createForOfIteratorHelper$4(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
5518
+ function _unsupportedIterableToArray$4(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$4(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen); }
5519
+ function _arrayLikeToArray$4(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5520
+ function formatAuthenticator(incoming) {
5521
+ var authenticator;
5522
+ if (isAuthenticator(incoming)) {
5523
+ authenticator = incoming;
5524
+ } else if (typeof incoming === 'string') {
5525
+ authenticator = {
5526
+ key: incoming
5527
+ };
5528
+ } else {
5529
+ throw new Error('Invalid format for authenticator');
5530
+ }
5531
+ return authenticator;
5532
+ }
5533
+ function compareAuthenticators(auth1, auth2) {
5534
+ if (!auth1 || !auth2) {
5535
+ return false;
5536
+ }
5537
+ if (auth1.id && auth2.id) {
5538
+ return auth1.id === auth2.id;
5539
+ }
5540
+ if (auth1.key && auth2.key) {
5541
+ return auth1.key === auth2.key;
5542
+ }
5543
+ return false;
5544
+ }
5545
+ function findMatchedOption(authenticators, options) {
5546
+ var option;
5547
+ var _iterator = _createForOfIteratorHelper$4(authenticators),
5548
+ _step;
5549
+ try {
5550
+ var _loop = function _loop() {
5551
+ var authenticator = _step.value;
5552
+ option = _findInstanceProperty(options).call(options, function (_ref) {
5553
+ var relatesTo = _ref.relatesTo;
5554
+ return relatesTo.key === authenticator.key;
5555
+ });
5556
+ if (option) {
5557
+ return "break";
5558
+ }
5559
+ };
5560
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
5561
+ var _ret = _loop();
5562
+ if (_ret === "break") break;
5563
+ }
5564
+ } catch (err) {
5565
+ _iterator.e(err);
5566
+ } finally {
5567
+ _iterator.f();
5568
+ }
5569
+ return option;
5570
+ }
5571
+
5595
5572
  function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
5596
- function _unsupportedIterableToArray$3(o, minLen) { var _context12; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = _sliceInstanceProperty(_context12 = Object.prototype.toString.call(o)).call(_context12, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
5573
+ function _unsupportedIterableToArray$3(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = _sliceInstanceProperty(_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
5597
5574
  function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5598
5575
  var Remediator = function () {
5599
5576
  function Remediator(remediation) {
5600
5577
  var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5578
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
5601
5579
  _classCallCheck(this, Remediator);
5602
5580
  this.values = _Object$assign({}, values);
5581
+ this.options = _Object$assign({}, options);
5603
5582
  this.formatAuthenticators();
5604
5583
  this.remediation = remediation;
5605
5584
  }
5606
5585
  _createClass(Remediator, [{
5607
5586
  key: "formatAuthenticators",
5608
5587
  value: function formatAuthenticators() {
5609
- var _this = this,
5610
- _context2,
5611
- _context3;
5588
+ var _context2, _context3;
5612
5589
  _valuesInstanceProperty(this).authenticators = _valuesInstanceProperty(this).authenticators || [];
5590
+ _valuesInstanceProperty(this).authenticators = _mapInstanceProperty(_context2 = _valuesInstanceProperty(this).authenticators).call(_context2, function (authenticator) {
5591
+ return formatAuthenticator(authenticator);
5592
+ });
5613
5593
  if (_valuesInstanceProperty(this).authenticator) {
5614
- var hasAuthenticatorInList = _valuesInstanceProperty(this).authenticators.some(function (authenticator) {
5615
- if (typeof authenticator === 'string') {
5616
- return authenticator === _valuesInstanceProperty(_this).authenticator;
5617
- }
5618
- return authenticator.key === _valuesInstanceProperty(_this).authenticator;
5594
+ var authenticator = formatAuthenticator(_valuesInstanceProperty(this).authenticator);
5595
+ var hasAuthenticatorInList = _valuesInstanceProperty(this).authenticators.some(function (existing) {
5596
+ return compareAuthenticators(authenticator, existing);
5619
5597
  });
5620
5598
  if (!hasAuthenticatorInList) {
5621
- _valuesInstanceProperty(this).authenticators.push({
5622
- key: _valuesInstanceProperty(this).authenticator
5623
- });
5599
+ _valuesInstanceProperty(this).authenticators.push(authenticator);
5624
5600
  }
5625
5601
  }
5626
- _valuesInstanceProperty(this).authenticators = _mapInstanceProperty(_context2 = _valuesInstanceProperty(this).authenticators).call(_context2, function (authenticator) {
5627
- return typeof authenticator === 'string' ? {
5628
- key: authenticator
5629
- } : authenticator;
5630
- });
5631
5602
  _valuesInstanceProperty(this).authenticatorsData = _reduceInstanceProperty(_context3 = _valuesInstanceProperty(this).authenticators).call(_context3, function (acc, authenticator) {
5632
5603
  if (_typeof(authenticator) === 'object' && _Object$keys(authenticator).length > 1) {
5633
5604
  acc.push(authenticator);
@@ -5643,13 +5614,10 @@ var Remediator = function () {
5643
5614
  }, {
5644
5615
  key: "canRemediate",
5645
5616
  value: function canRemediate() {
5646
- var _this2 = this;
5647
- if (!_mapInstanceProperty(this)) {
5648
- return false;
5649
- }
5617
+ var _this = this;
5650
5618
  var required = getRequiredValues(this.remediation);
5651
5619
  var needed = _findInstanceProperty(required).call(required, function (key) {
5652
- return !_this2.hasData(key);
5620
+ return !_this.hasData(key);
5653
5621
  });
5654
5622
  if (needed) {
5655
5623
  return false;
@@ -5659,48 +5627,41 @@ var Remediator = function () {
5659
5627
  }, {
5660
5628
  key: "getData",
5661
5629
  value: function getData(key) {
5662
- var _this3 = this;
5630
+ var _this2 = this;
5663
5631
  if (!key) {
5664
5632
  var allValues = getAllValues(this.remediation);
5665
5633
  var res = _reduceInstanceProperty(allValues).call(allValues, function (data, key) {
5666
- data[key] = _this3.getData(key);
5634
+ data[key] = _this2.getData(key);
5667
5635
  return data;
5668
5636
  }, {});
5669
5637
  return res;
5670
5638
  }
5671
5639
  if (typeof this["map".concat(titleCase(key))] === 'function') {
5672
5640
  var _context4;
5673
- return this["map".concat(titleCase(key))](_findInstanceProperty(_context4 = this.remediation.value).call(_context4, function (_ref) {
5641
+ var val = this["map".concat(titleCase(key))](_findInstanceProperty(_context4 = this.remediation.value).call(_context4, function (_ref) {
5674
5642
  var name = _ref.name;
5675
5643
  return name === key;
5676
5644
  }));
5677
- }
5678
- if (!_mapInstanceProperty(this)) {
5679
- return _valuesInstanceProperty(this)[key];
5680
- }
5681
- var entry = _mapInstanceProperty(this)[key];
5682
- if (!entry) {
5683
- return _valuesInstanceProperty(this)[key];
5684
- }
5685
- for (var i = 0; i < entry.length; i++) {
5686
- var val = _valuesInstanceProperty(this)[entry[i]];
5687
5645
  if (val) {
5688
5646
  return val;
5689
5647
  }
5690
5648
  }
5649
+ if (_mapInstanceProperty(this) && _mapInstanceProperty(this)[key]) {
5650
+ var entry = _mapInstanceProperty(this)[key];
5651
+ for (var i = 0; i < entry.length; i++) {
5652
+ var _val = _valuesInstanceProperty(this)[entry[i]];
5653
+ if (_val) {
5654
+ return _val;
5655
+ }
5656
+ }
5657
+ }
5658
+ return _valuesInstanceProperty(this)[key];
5691
5659
  }
5692
5660
  }, {
5693
5661
  key: "hasData",
5694
5662
  value: function hasData(key
5695
5663
  ) {
5696
- var data = this.getData(key);
5697
- if (_typeof(data) === 'object') {
5698
- var _context5;
5699
- return !!_findInstanceProperty(_context5 = _Object$keys(data)).call(_context5, function (key) {
5700
- return !!data[key];
5701
- });
5702
- }
5703
- return !!data;
5664
+ return !!this.getData(key);
5704
5665
  }
5705
5666
  }, {
5706
5667
  key: "getNextStep",
@@ -5721,43 +5682,38 @@ var Remediator = function () {
5721
5682
  }, {
5722
5683
  key: "getInputs",
5723
5684
  value: function getInputs() {
5724
- var _context6,
5725
- _this4 = this;
5726
- if (!_mapInstanceProperty(this)) {
5727
- return [];
5728
- }
5729
- return _reduceInstanceProperty(_context6 = _Object$keys(_mapInstanceProperty(this))).call(_context6, function (inputs, key) {
5730
- var _context7;
5731
- var inputFromRemediation = _findInstanceProperty(_context7 = _this4.remediation.value).call(_context7, function (item) {
5732
- return item.name === key;
5733
- });
5734
- if (!inputFromRemediation) {
5735
- return inputs;
5736
- }
5685
+ var _this3 = this;
5686
+ var inputs = [];
5687
+ var inputsFromRemediation = this.remediation.value || [];
5688
+ inputsFromRemediation.forEach(function (inputFromRemediation) {
5737
5689
  var input;
5738
- var aliases = _mapInstanceProperty(_this4)[key];
5739
- var type = inputFromRemediation.type;
5740
- if (typeof _this4["getInput".concat(titleCase(key))] === 'function') {
5741
- input = _this4["getInput".concat(titleCase(key))](inputFromRemediation);
5690
+ var name = inputFromRemediation.name,
5691
+ type = inputFromRemediation.type,
5692
+ visible = inputFromRemediation.visible;
5693
+ if (visible === false) {
5694
+ return;
5695
+ }
5696
+ if (typeof _this3["getInput".concat(titleCase(name))] === 'function') {
5697
+ input = _this3["getInput".concat(titleCase(name))](inputFromRemediation);
5742
5698
  } else if (type !== 'object') {
5743
- var name;
5699
+ var alias;
5700
+ var aliases = (_mapInstanceProperty(_this3) ? _mapInstanceProperty(_this3)[name] : null) || [];
5744
5701
  if (aliases.length === 1) {
5745
- name = aliases[0];
5702
+ alias = aliases[0];
5746
5703
  } else {
5747
- name = _findInstanceProperty(aliases).call(aliases, function (name) {
5748
- var _context8;
5749
- return _includesInstanceProperty(_context8 = _Object$keys(_valuesInstanceProperty(_this4))).call(_context8, name);
5704
+ alias = _findInstanceProperty(aliases).call(aliases, function (name) {
5705
+ var _context5;
5706
+ return _includesInstanceProperty(_context5 = _Object$keys(_valuesInstanceProperty(_this3))).call(_context5, name);
5750
5707
  });
5751
5708
  }
5752
- if (name) {
5709
+ if (alias) {
5753
5710
  input = _Object$assign(_Object$assign({}, inputFromRemediation), {
5754
- name: name
5711
+ name: alias
5755
5712
  });
5756
5713
  }
5757
5714
  }
5758
5715
  if (!input) {
5759
- var _context9;
5760
- throw new AuthSdkError(_concatInstanceProperty(_context9 = "Missing custom getInput".concat(titleCase(key), " method in Remediator: ")).call(_context9, _this4.getName()));
5716
+ input = inputFromRemediation;
5761
5717
  }
5762
5718
  if (Array.isArray(input)) {
5763
5719
  input.forEach(function (i) {
@@ -5766,8 +5722,8 @@ var Remediator = function () {
5766
5722
  } else {
5767
5723
  inputs.push(input);
5768
5724
  }
5769
- return inputs;
5770
- }, []);
5725
+ });
5726
+ return inputs;
5771
5727
  }
5772
5728
  }, {
5773
5729
  key: "getValuesAfterProceed",
@@ -5791,21 +5747,41 @@ var Remediator = function () {
5791
5747
  }, {
5792
5748
  key: "getAuthenticator",
5793
5749
  value: function getAuthenticator() {
5794
- var _a;
5795
- return (_a = this.remediation.relatesTo) === null || _a === void 0 ? void 0 : _a.value;
5750
+ var _context6, _context7;
5751
+ var _a, _b;
5752
+ var relatesTo = (_a = this.remediation.relatesTo) === null || _a === void 0 ? void 0 : _a.value;
5753
+ if (!relatesTo) {
5754
+ return;
5755
+ }
5756
+ var authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);
5757
+ if (!authenticatorFromRemediation) {
5758
+ return relatesTo;
5759
+ }
5760
+ var id = _findInstanceProperty(_context6 = authenticatorFromRemediation.form.value).call(_context6, function (_ref2) {
5761
+ var name = _ref2.name;
5762
+ return name === 'id';
5763
+ }).value;
5764
+ var enrollmentId = (_b = _findInstanceProperty(_context7 = authenticatorFromRemediation.form.value).call(_context7, function (_ref3) {
5765
+ var name = _ref3.name;
5766
+ return name === 'enrollmentId';
5767
+ })) === null || _b === void 0 ? void 0 : _b.value;
5768
+ return _Object$assign(_Object$assign({}, relatesTo), {
5769
+ id: id,
5770
+ enrollmentId: enrollmentId
5771
+ });
5796
5772
  }
5797
5773
  }], [{
5798
5774
  key: "getMessages",
5799
5775
  value: function getMessages(remediation) {
5800
- var _context10;
5776
+ var _context8;
5801
5777
  var _a, _b;
5802
5778
  if (!remediation.value) {
5803
5779
  return;
5804
5780
  }
5805
- return (_b = (_a = remediation.value[0]) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _reduceInstanceProperty(_context10 = _b.value).call(_context10, function (messages, field) {
5781
+ return (_b = (_a = remediation.value[0]) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _reduceInstanceProperty(_context8 = _b.value).call(_context8, function (messages, field) {
5806
5782
  if (field.messages) {
5807
- var _context11;
5808
- messages = _concatInstanceProperty(_context11 = []).call(_context11, _toConsumableArray(messages), _toConsumableArray(field.messages.value));
5783
+ var _context9;
5784
+ messages = _concatInstanceProperty(_context9 = []).call(_context9, _toConsumableArray(messages), _toConsumableArray(field.messages.value));
5809
5785
  }
5810
5786
  return messages;
5811
5787
  }, []);
@@ -5831,13 +5807,19 @@ var VerificationCodeAuthenticator = function (_Authenticator) {
5831
5807
  _createClass(VerificationCodeAuthenticator, [{
5832
5808
  key: "canVerify",
5833
5809
  value: function canVerify(values) {
5834
- return !!(values.verificationCode || values.otp);
5810
+ return !!(values.credentials || values.verificationCode || values.otp);
5835
5811
  }
5836
5812
  }, {
5837
5813
  key: "mapCredentials",
5838
5814
  value: function mapCredentials(values) {
5839
- return {
5840
- passcode: values.verificationCode || values.otp
5815
+ var credentials = values.credentials,
5816
+ verificationCode = values.verificationCode,
5817
+ otp = values.otp;
5818
+ if (!credentials && !verificationCode && !otp) {
5819
+ return;
5820
+ }
5821
+ return credentials || {
5822
+ passcode: verificationCode || otp
5841
5823
  };
5842
5824
  }
5843
5825
  }, {
@@ -5866,8 +5848,12 @@ var OktaVerifyTotp = function (_VerificationCodeAuth) {
5866
5848
  _createClass(OktaVerifyTotp, [{
5867
5849
  key: "mapCredentials",
5868
5850
  value: function mapCredentials(values) {
5851
+ var verificationCode = values.verificationCode;
5852
+ if (!verificationCode) {
5853
+ return;
5854
+ }
5869
5855
  return {
5870
- totp: values.verificationCode
5856
+ totp: verificationCode
5871
5857
  };
5872
5858
  }
5873
5859
  }]);
@@ -5886,13 +5872,18 @@ var OktaPassword = function (_Authenticator) {
5886
5872
  _createClass(OktaPassword, [{
5887
5873
  key: "canVerify",
5888
5874
  value: function canVerify(values) {
5889
- return !!values.password;
5875
+ return !!(values.credentials || values.password);
5890
5876
  }
5891
5877
  }, {
5892
5878
  key: "mapCredentials",
5893
5879
  value: function mapCredentials(values) {
5894
- return {
5895
- passcode: values.password
5880
+ var credentials = values.credentials,
5881
+ password = values.password;
5882
+ if (!credentials && !password) {
5883
+ return;
5884
+ }
5885
+ return credentials || {
5886
+ passcode: password
5896
5887
  };
5897
5888
  }
5898
5889
  }, {
@@ -5921,6 +5912,10 @@ var SecurityQuestionEnrollment = function (_Authenticator) {
5921
5912
  _createClass(SecurityQuestionEnrollment, [{
5922
5913
  key: "canVerify",
5923
5914
  value: function canVerify(values) {
5915
+ var credentials = values.credentials;
5916
+ if (credentials && credentials.questionKey && credentials.answer) {
5917
+ return true;
5918
+ }
5924
5919
  var questionKey = values.questionKey,
5925
5920
  question = values.question,
5926
5921
  answer = values.answer;
@@ -5932,6 +5927,9 @@ var SecurityQuestionEnrollment = function (_Authenticator) {
5932
5927
  var questionKey = values.questionKey,
5933
5928
  question = values.question,
5934
5929
  answer = values.answer;
5930
+ if (!questionKey && !question && !answer) {
5931
+ return;
5932
+ }
5935
5933
  return {
5936
5934
  questionKey: question ? 'custom' : questionKey,
5937
5935
  question: question,
@@ -5944,7 +5942,7 @@ var SecurityQuestionEnrollment = function (_Authenticator) {
5944
5942
  return [{
5945
5943
  name: 'questionKey',
5946
5944
  type: 'string',
5947
- require: true
5945
+ required: true
5948
5946
  }, {
5949
5947
  name: 'question',
5950
5948
  type: 'string',
@@ -5977,9 +5975,13 @@ var SecurityQuestionVerification = function (_Authenticator) {
5977
5975
  }, {
5978
5976
  key: "mapCredentials",
5979
5977
  value: function mapCredentials(values) {
5978
+ var answer = values.answer;
5979
+ if (!answer) {
5980
+ return;
5981
+ }
5980
5982
  return {
5981
5983
  questionKey: this.meta.contextualData.enrolledQuestion.questionKey,
5982
- answer: values.answer
5984
+ answer: answer
5983
5985
  };
5984
5986
  }
5985
5987
  }, {
@@ -6017,6 +6019,9 @@ var WebauthnEnrollment = function (_Authenticator) {
6017
6019
  value: function mapCredentials(values) {
6018
6020
  var clientData = values.clientData,
6019
6021
  attestation = values.attestation;
6022
+ if (!clientData && !attestation) {
6023
+ return;
6024
+ }
6020
6025
  return {
6021
6026
  clientData: clientData,
6022
6027
  attestation: attestation
@@ -6066,6 +6071,9 @@ var WebauthnVerification = function (_Authenticator) {
6066
6071
  var authenticatorData = values.authenticatorData,
6067
6072
  clientData = values.clientData,
6068
6073
  signatureData = values.signatureData;
6074
+ if (!authenticatorData && !clientData && !signatureData) {
6075
+ return;
6076
+ }
6069
6077
  return {
6070
6078
  authenticatorData: authenticatorData,
6071
6079
  clientData: clientData,
@@ -6135,9 +6143,6 @@ var VerifyAuthenticator = function (_Remediator) {
6135
6143
  var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6136
6144
  _classCallCheck(this, VerifyAuthenticator);
6137
6145
  _this = _super.call(this, remediation, values);
6138
- _this.map = {
6139
- 'credentials': []
6140
- };
6141
6146
  _this.authenticator = getAuthenticator(remediation);
6142
6147
  return _this;
6143
6148
  }
@@ -6166,6 +6171,19 @@ var VerifyAuthenticator = function (_Remediator) {
6166
6171
  value: function getInputCredentials(input) {
6167
6172
  return this.authenticator.getInputs(input);
6168
6173
  }
6174
+ }, {
6175
+ key: "getValuesAfterProceed",
6176
+ value: function getValuesAfterProceed() {
6177
+ var _context,
6178
+ _this2 = this;
6179
+ this.values = _get(_getPrototypeOf(VerifyAuthenticator.prototype), "getValuesAfterProceed", this).call(this);
6180
+ var trimmedValues = _filterInstanceProperty(_context = _Object$keys(_valuesInstanceProperty(this))).call(_context, function (valueKey) {
6181
+ return valueKey !== 'credentials';
6182
+ });
6183
+ return _reduceInstanceProperty(trimmedValues).call(trimmedValues, function (values, valueKey) {
6184
+ return _Object$assign(_Object$assign({}, values), _defineProperty({}, valueKey, _valuesInstanceProperty(_this2)[valueKey]));
6185
+ }, {});
6186
+ }
6169
6187
  }]);
6170
6188
  return VerifyAuthenticator;
6171
6189
  }(Remediator);
@@ -6195,7 +6213,7 @@ var EnrollPoll = function (_Remediator) {
6195
6213
  _createClass(EnrollPoll, [{
6196
6214
  key: "canRemediate",
6197
6215
  value: function canRemediate() {
6198
- return Boolean(_valuesInstanceProperty(this).startPolling);
6216
+ return !!_valuesInstanceProperty(this).startPolling || this.options.step === 'enroll-poll';
6199
6217
  }
6200
6218
  }, {
6201
6219
  key: "getNextStep",
@@ -6303,14 +6321,8 @@ var EnrollmentChannelData = function (_Remediator) {
6303
6321
  _inherits(EnrollmentChannelData, _Remediator);
6304
6322
  var _super = _createSuper$h(EnrollmentChannelData);
6305
6323
  function EnrollmentChannelData() {
6306
- var _this;
6307
6324
  _classCallCheck(this, EnrollmentChannelData);
6308
- _this = _super.apply(this, arguments);
6309
- _this.map = {
6310
- email: [],
6311
- phoneNumber: []
6312
- };
6313
- return _this;
6325
+ return _super.apply(this, arguments);
6314
6326
  }
6315
6327
  _createClass(EnrollmentChannelData, [{
6316
6328
  key: "getInputEmail",
@@ -6359,13 +6371,13 @@ var EnrollmentChannelData = function (_Remediator) {
6359
6371
  key: "getValuesAfterProceed",
6360
6372
  value: function getValuesAfterProceed() {
6361
6373
  var _context,
6362
- _this2 = this;
6374
+ _this = this;
6363
6375
  var trimmedValues = _filterInstanceProperty(_context = _Object$keys(_valuesInstanceProperty(this))).call(_context, function (valueKey) {
6364
6376
  var _context2;
6365
6377
  return !_includesInstanceProperty(_context2 = ['email', 'phoneNumber']).call(_context2, valueKey);
6366
6378
  });
6367
6379
  return _reduceInstanceProperty(trimmedValues).call(trimmedValues, function (values, valueKey) {
6368
- return _Object$assign(_Object$assign({}, values), _defineProperty({}, valueKey, _valuesInstanceProperty(_this2)[valueKey]));
6380
+ return _Object$assign(_Object$assign({}, values), _defineProperty({}, valueKey, _valuesInstanceProperty(_this)[valueKey]));
6369
6381
  }, {});
6370
6382
  }
6371
6383
  }]);
@@ -6395,6 +6407,12 @@ var ChallengePoll = function (_EnrollPoll) {
6395
6407
  _classCallCheck(this, ChallengePoll);
6396
6408
  return _super.apply(this, arguments);
6397
6409
  }
6410
+ _createClass(ChallengePoll, [{
6411
+ key: "canRemediate",
6412
+ value: function canRemediate() {
6413
+ return !!_valuesInstanceProperty(this).startPolling || this.options.step === 'challenge-poll';
6414
+ }
6415
+ }]);
6398
6416
  return ChallengePoll;
6399
6417
  }(EnrollPoll);
6400
6418
  ChallengePoll.remediationName = 'challenge-poll';
@@ -6418,19 +6436,17 @@ var EnrollProfile = function (_Remediator) {
6418
6436
  _inherits(EnrollProfile, _Remediator);
6419
6437
  var _super = _createSuper$d(EnrollProfile);
6420
6438
  function EnrollProfile() {
6421
- var _this;
6422
6439
  _classCallCheck(this, EnrollProfile);
6423
- _this = _super.apply(this, arguments);
6424
- _this.map = {
6425
- 'userProfile': []
6426
- };
6427
- return _this;
6440
+ return _super.apply(this, arguments);
6428
6441
  }
6429
6442
  _createClass(EnrollProfile, [{
6430
6443
  key: "canRemediate",
6431
6444
  value: function canRemediate() {
6432
6445
  var _context, _context2;
6433
6446
  var userProfileFromValues = this.getData().userProfile;
6447
+ if (!userProfileFromValues) {
6448
+ return false;
6449
+ }
6434
6450
  var userProfileFromRemediation = _findInstanceProperty(_context = this.remediation.value).call(_context, function (_ref) {
6435
6451
  var name = _ref.name;
6436
6452
  return name === 'userProfile';
@@ -6445,15 +6461,19 @@ var EnrollProfile = function (_Remediator) {
6445
6461
  }, {
6446
6462
  key: "mapUserProfile",
6447
6463
  value: function mapUserProfile(_ref2) {
6448
- var _this2 = this;
6464
+ var _this = this;
6449
6465
  var profileAttributes = _ref2.form.value;
6450
6466
  var attributeNames = _mapInstanceProperty(profileAttributes).call(profileAttributes, function (_ref3) {
6451
6467
  var name = _ref3.name;
6452
6468
  return name;
6453
6469
  });
6454
- return _reduceInstanceProperty(attributeNames).call(attributeNames, function (attributeValues, attributeName) {
6455
- return _valuesInstanceProperty(_this2)[attributeName] ? _Object$assign(_Object$assign({}, attributeValues), _defineProperty({}, attributeName, _valuesInstanceProperty(_this2)[attributeName])) : attributeValues;
6470
+ var data = _reduceInstanceProperty(attributeNames).call(attributeNames, function (attributeValues, attributeName) {
6471
+ return _valuesInstanceProperty(_this)[attributeName] ? _Object$assign(_Object$assign({}, attributeValues), _defineProperty({}, attributeName, _valuesInstanceProperty(_this)[attributeName])) : attributeValues;
6456
6472
  }, {});
6473
+ if (_Object$keys(data).length === 0) {
6474
+ return;
6475
+ }
6476
+ return data;
6457
6477
  }
6458
6478
  }, {
6459
6479
  key: "getInputUserProfile",
@@ -6486,9 +6506,7 @@ var Identify = function (_Remediator) {
6486
6506
  _classCallCheck(this, Identify);
6487
6507
  _this = _super.apply(this, arguments);
6488
6508
  _this.map = {
6489
- 'identifier': ['username'],
6490
- 'credentials': [],
6491
- 'rememberMe': ['rememberMe']
6509
+ 'identifier': ['username']
6492
6510
  };
6493
6511
  return _this;
6494
6512
  }
@@ -6502,8 +6520,14 @@ var Identify = function (_Remediator) {
6502
6520
  }, {
6503
6521
  key: "mapCredentials",
6504
6522
  value: function mapCredentials() {
6505
- return {
6506
- passcode: _valuesInstanceProperty(this).password
6523
+ var _this$values = _valuesInstanceProperty(this),
6524
+ credentials = _this$values.credentials,
6525
+ password = _this$values.password;
6526
+ if (!credentials && !password) {
6527
+ return;
6528
+ }
6529
+ return credentials || {
6530
+ passcode: password
6507
6531
  };
6508
6532
  }
6509
6533
  }, {
@@ -6525,19 +6549,18 @@ var ReEnrollAuthenticator = function (_Remediator) {
6525
6549
  _inherits(ReEnrollAuthenticator, _Remediator);
6526
6550
  var _super = _createSuper$b(ReEnrollAuthenticator);
6527
6551
  function ReEnrollAuthenticator() {
6528
- var _this;
6529
6552
  _classCallCheck(this, ReEnrollAuthenticator);
6530
- _this = _super.apply(this, arguments);
6531
- _this.map = {
6532
- 'credentials': []
6533
- };
6534
- return _this;
6553
+ return _super.apply(this, arguments);
6535
6554
  }
6536
6555
  _createClass(ReEnrollAuthenticator, [{
6537
6556
  key: "mapCredentials",
6538
6557
  value: function mapCredentials() {
6558
+ var newPassword = _valuesInstanceProperty(this).newPassword;
6559
+ if (!newPassword) {
6560
+ return;
6561
+ }
6539
6562
  return {
6540
- passcode: _valuesInstanceProperty(this).newPassword
6563
+ passcode: newPassword
6541
6564
  };
6542
6565
  }
6543
6566
  }, {
@@ -6597,17 +6620,13 @@ var SelectAuthenticator = function (_Remediator) {
6597
6620
  _inherits(SelectAuthenticator, _Remediator);
6598
6621
  var _super = _createSuper$9(SelectAuthenticator);
6599
6622
  function SelectAuthenticator() {
6600
- var _this;
6601
6623
  _classCallCheck(this, SelectAuthenticator);
6602
- _this = _super.apply(this, arguments);
6603
- _this.map = {
6604
- authenticator: []
6605
- };
6606
- return _this;
6624
+ return _super.apply(this, arguments);
6607
6625
  }
6608
6626
  _createClass(SelectAuthenticator, [{
6609
6627
  key: "findMatchedOption",
6610
- value: function findMatchedOption(authenticators, options) {
6628
+ value:
6629
+ function findMatchedOption(authenticators, options) {
6611
6630
  var option;
6612
6631
  var _iterator = _createForOfIteratorHelper$2(authenticators),
6613
6632
  _step;
@@ -6636,12 +6655,17 @@ var SelectAuthenticator = function (_Remediator) {
6636
6655
  }, {
6637
6656
  key: "canRemediate",
6638
6657
  value: function canRemediate() {
6639
- var authenticators = _valuesInstanceProperty(this).authenticators;
6658
+ var _this$values = _valuesInstanceProperty(this),
6659
+ authenticators = _this$values.authenticators,
6660
+ authenticator = _this$values.authenticator;
6640
6661
  var authenticatorFromRemediation = getAuthenticatorFromRemediation(this.remediation);
6641
6662
  var options = authenticatorFromRemediation.options;
6642
6663
  if (!authenticators || !authenticators.length) {
6643
6664
  return false;
6644
6665
  }
6666
+ if (isAuthenticator(authenticator) && authenticator.id) {
6667
+ return true;
6668
+ }
6645
6669
  var matchedOption = this.findMatchedOption(authenticators, options);
6646
6670
  if (matchedOption) {
6647
6671
  return true;
@@ -6671,9 +6695,15 @@ var SelectAuthenticator = function (_Remediator) {
6671
6695
  key: "mapAuthenticator",
6672
6696
  value: function mapAuthenticator(remediationValue) {
6673
6697
  var _context2;
6674
- var authenticators = _valuesInstanceProperty(this).authenticators;
6698
+ var _this$values2 = _valuesInstanceProperty(this),
6699
+ authenticators = _this$values2.authenticators,
6700
+ authenticator = _this$values2.authenticator;
6701
+ if (isAuthenticator(authenticator) && authenticator.id) {
6702
+ this.selectedAuthenticator = authenticator;
6703
+ return authenticator;
6704
+ }
6675
6705
  var options = remediationValue.options;
6676
- var selectedOption = this.findMatchedOption(authenticators, options);
6706
+ var selectedOption = findMatchedOption(authenticators, options);
6677
6707
  this.selectedAuthenticator = selectedOption.relatesTo;
6678
6708
  this.selectedOption = selectedOption;
6679
6709
  return {
@@ -6695,10 +6725,10 @@ var SelectAuthenticator = function (_Remediator) {
6695
6725
  key: "getValuesAfterProceed",
6696
6726
  value: function getValuesAfterProceed() {
6697
6727
  var _context3,
6698
- _this2 = this;
6728
+ _this = this;
6699
6729
  this.values = _get(_getPrototypeOf(SelectAuthenticator.prototype), "getValuesAfterProceed", this).call(this);
6700
6730
  var authenticators = _filterInstanceProperty(_context3 = _valuesInstanceProperty(this).authenticators).call(_context3, function (authenticator) {
6701
- return authenticator.key !== _this2.selectedAuthenticator.key;
6731
+ return compareAuthenticators(authenticator, _this.selectedAuthenticator) !== true;
6702
6732
  });
6703
6733
  return _Object$assign(_Object$assign({}, _valuesInstanceProperty(this)), {
6704
6734
  authenticators: authenticators
@@ -6716,14 +6746,16 @@ var SelectAuthenticatorAuthenticate = function (_SelectAuthenticator) {
6716
6746
  function SelectAuthenticatorAuthenticate(remediation) {
6717
6747
  var _this;
6718
6748
  var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6749
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
6719
6750
  _classCallCheck(this, SelectAuthenticatorAuthenticate);
6720
6751
  var _a;
6721
- _this = _super.call(this, remediation, values);
6752
+ _this = _super.call(this, remediation, values, options);
6753
+ var isRecoveryFlow = _this.options.flow === 'recoverPassword';
6722
6754
  var hasPasswordInOptions = (_a = getAuthenticatorFromRemediation(remediation).options) === null || _a === void 0 ? void 0 : _a.some(function (_ref) {
6723
6755
  var relatesTo = _ref.relatesTo;
6724
6756
  return (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.key) === AuthenticatorKey.OKTA_PASSWORD;
6725
6757
  });
6726
- if (hasPasswordInOptions && (_valuesInstanceProperty(_this).flow === 'recoverPassword' || _valuesInstanceProperty(_this).password)) {
6758
+ if (hasPasswordInOptions && (isRecoveryFlow || _valuesInstanceProperty(_this).password)) {
6727
6759
  var _context;
6728
6760
  _valuesInstanceProperty(_this).authenticators = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(_valuesInstanceProperty(_this).authenticators || []), [{
6729
6761
  key: AuthenticatorKey.OKTA_PASSWORD
@@ -6758,7 +6790,6 @@ var SelectAuthenticatorUnlockAccount = function (_SelectAuthenticator) {
6758
6790
  _classCallCheck(this, SelectAuthenticatorUnlockAccount);
6759
6791
  _this = _super.apply(this, arguments);
6760
6792
  _this.map = {
6761
- authenticator: [],
6762
6793
  identifier: ['username']
6763
6794
  };
6764
6795
  return _this;
@@ -6829,9 +6860,6 @@ var AuthenticatorData = function (_Remediator) {
6829
6860
  var values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6830
6861
  _classCallCheck(this, AuthenticatorData);
6831
6862
  _this = _super.call(this, remediation, values);
6832
- _this.map = {
6833
- 'authenticator': []
6834
- };
6835
6863
  _this.authenticator = _this.getAuthenticator();
6836
6864
  _this.formatAuthenticatorData();
6837
6865
  return _this;
@@ -6844,7 +6872,7 @@ var AuthenticatorData = function (_Remediator) {
6844
6872
  if (authenticatorData) {
6845
6873
  var _context;
6846
6874
  _valuesInstanceProperty(this).authenticatorsData = _mapInstanceProperty(_context = _valuesInstanceProperty(this).authenticatorsData).call(_context, function (data) {
6847
- if (data.key === _this2.authenticator.key) {
6875
+ if (compareAuthenticators(_this2.authenticator, data)) {
6848
6876
  return _this2.mapAuthenticatorDataFromValues(data);
6849
6877
  }
6850
6878
  return data;
@@ -6861,9 +6889,8 @@ var AuthenticatorData = function (_Remediator) {
6861
6889
  value: function getAuthenticatorData() {
6862
6890
  var _context2,
6863
6891
  _this3 = this;
6864
- return _findInstanceProperty(_context2 = _valuesInstanceProperty(this).authenticatorsData).call(_context2, function (_ref) {
6865
- var key = _ref.key;
6866
- return key === _this3.authenticator.key;
6892
+ return _findInstanceProperty(_context2 = _valuesInstanceProperty(this).authenticatorsData).call(_context2, function (data) {
6893
+ return compareAuthenticators(_this3.authenticator, data);
6867
6894
  });
6868
6895
  }
6869
6896
  }, {
@@ -6871,7 +6898,7 @@ var AuthenticatorData = function (_Remediator) {
6871
6898
  value: function canRemediate() {
6872
6899
  var _this4 = this;
6873
6900
  return _valuesInstanceProperty(this).authenticatorsData.some(function (data) {
6874
- return data.key === _this4.authenticator.key;
6901
+ return compareAuthenticators(_this4.authenticator, data);
6875
6902
  });
6876
6903
  }
6877
6904
  }, {
@@ -6886,9 +6913,18 @@ var AuthenticatorData = function (_Remediator) {
6886
6913
  }, {
6887
6914
  key: "mapAuthenticatorDataFromValues",
6888
6915
  value: function mapAuthenticatorDataFromValues(authenticatorData) {
6889
- var methodType = _valuesInstanceProperty(this).methodType;
6916
+ var _this$values = _valuesInstanceProperty(this),
6917
+ methodType = _this$values.methodType,
6918
+ authenticator = _this$values.authenticator;
6919
+ if (!methodType && isAuthenticator(authenticator)) {
6920
+ methodType = authenticator === null || authenticator === void 0 ? void 0 : authenticator.methodType;
6921
+ }
6922
+ var _this$authenticator = this.authenticator,
6923
+ id = _this$authenticator.id,
6924
+ enrollmentId = _this$authenticator.enrollmentId;
6890
6925
  var data = _Object$assign(_Object$assign({
6891
- key: this.authenticator.key
6926
+ id: id,
6927
+ enrollmentId: enrollmentId
6892
6928
  }, authenticatorData && authenticatorData), methodType && {
6893
6929
  methodType: methodType
6894
6930
  });
@@ -6898,8 +6934,8 @@ var AuthenticatorData = function (_Remediator) {
6898
6934
  key: "getAuthenticatorFromRemediation",
6899
6935
  value: function getAuthenticatorFromRemediation() {
6900
6936
  var _context3;
6901
- var authenticator = _findInstanceProperty(_context3 = this.remediation.value).call(_context3, function (_ref2) {
6902
- var name = _ref2.name;
6937
+ var authenticator = _findInstanceProperty(_context3 = this.remediation.value).call(_context3, function (_ref) {
6938
+ var name = _ref.name;
6903
6939
  return name === 'authenticator';
6904
6940
  });
6905
6941
  return authenticator;
@@ -6910,8 +6946,8 @@ var AuthenticatorData = function (_Remediator) {
6910
6946
  var _context4;
6911
6947
  var _a;
6912
6948
  var authenticator = this.getAuthenticatorFromRemediation();
6913
- return (_a = _findInstanceProperty(_context4 = authenticator.form.value).call(_context4, function (_ref3) {
6914
- var name = _ref3.name;
6949
+ return (_a = _findInstanceProperty(_context4 = authenticator.form.value).call(_context4, function (_ref2) {
6950
+ var name = _ref2.name;
6915
6951
  return name === 'methodType';
6916
6952
  })) === null || _a === void 0 ? void 0 : _a.options;
6917
6953
  }
@@ -6922,7 +6958,7 @@ var AuthenticatorData = function (_Remediator) {
6922
6958
  _this5 = this;
6923
6959
  this.values = _get(_getPrototypeOf(AuthenticatorData.prototype), "getValuesAfterProceed", this).call(this);
6924
6960
  var authenticatorsData = _filterInstanceProperty(_context5 = _valuesInstanceProperty(this).authenticatorsData).call(_context5, function (data) {
6925
- return data.key !== _this5.authenticator.key;
6961
+ return compareAuthenticators(_this5.authenticator, data) !== true;
6926
6962
  });
6927
6963
  return _Object$assign(_Object$assign({}, _valuesInstanceProperty(this)), {
6928
6964
  authenticatorsData: authenticatorsData
@@ -6956,12 +6992,10 @@ var AuthenticatorVerificationData = function (_AuthenticatorData) {
6956
6992
  }, {
6957
6993
  key: "mapAuthenticator",
6958
6994
  value: function mapAuthenticator() {
6959
- var _context2, _context3;
6960
- var _a, _b;
6961
- var authenticatorData = this.getAuthenticatorData();
6962
- var authenticatorFromRemediation = this.getAuthenticatorFromRemediation();
6995
+ var _a;
6963
6996
  if (this.shouldProceedWithEmailAuthenticator) {
6964
6997
  var _context;
6998
+ var authenticatorFromRemediation = this.getAuthenticatorFromRemediation();
6965
6999
  return (_a = authenticatorFromRemediation.form) === null || _a === void 0 ? void 0 : _reduceInstanceProperty(_context = _a.value).call(_context, function (acc, curr) {
6966
7000
  if (curr.value) {
6967
7001
  acc[curr.name] = curr.value;
@@ -6973,25 +7007,15 @@ var AuthenticatorVerificationData = function (_AuthenticatorData) {
6973
7007
  return acc;
6974
7008
  }, {});
6975
7009
  }
6976
- return {
6977
- id: _findInstanceProperty(_context2 = authenticatorFromRemediation.form.value).call(_context2, function (_ref) {
6978
- var name = _ref.name;
6979
- return name === 'id';
6980
- }).value,
6981
- enrollmentId: (_b = _findInstanceProperty(_context3 = authenticatorFromRemediation.form.value).call(_context3, function (_ref2) {
6982
- var name = _ref2.name;
6983
- return name === 'enrollmentId';
6984
- })) === null || _b === void 0 ? void 0 : _b.value,
6985
- methodType: authenticatorData === null || authenticatorData === void 0 ? void 0 : authenticatorData.methodType
6986
- };
7010
+ return this.getAuthenticatorData();
6987
7011
  }
6988
7012
  }, {
6989
7013
  key: "getInputAuthenticator",
6990
7014
  value: function getInputAuthenticator() {
6991
- var _context4;
7015
+ var _context2;
6992
7016
  var authenticator = this.getAuthenticatorFromRemediation();
6993
- var methodType = _findInstanceProperty(_context4 = authenticator.form.value).call(_context4, function (_ref3) {
6994
- var name = _ref3.name;
7017
+ var methodType = _findInstanceProperty(_context2 = authenticator.form.value).call(_context2, function (_ref) {
7018
+ var name = _ref.name;
6995
7019
  return name === 'methodType';
6996
7020
  });
6997
7021
  if (methodType && methodType.options) {
@@ -7004,6 +7028,19 @@ var AuthenticatorVerificationData = function (_AuthenticatorData) {
7004
7028
  var inputs = _toConsumableArray(authenticator.form.value);
7005
7029
  return inputs;
7006
7030
  }
7031
+ }, {
7032
+ key: "getValuesAfterProceed",
7033
+ value: function getValuesAfterProceed() {
7034
+ var _context3,
7035
+ _this2 = this;
7036
+ this.values = _get(_getPrototypeOf(AuthenticatorVerificationData.prototype), "getValuesAfterProceed", this).call(this);
7037
+ var trimmedValues = _filterInstanceProperty(_context3 = _Object$keys(_valuesInstanceProperty(this))).call(_context3, function (valueKey) {
7038
+ return valueKey !== 'authenticator';
7039
+ });
7040
+ return _reduceInstanceProperty(trimmedValues).call(trimmedValues, function (values, valueKey) {
7041
+ return _Object$assign(_Object$assign({}, values), _defineProperty({}, valueKey, _valuesInstanceProperty(_this2)[valueKey]));
7042
+ }, {});
7043
+ }
7007
7044
  }]);
7008
7045
  return AuthenticatorVerificationData;
7009
7046
  }(AuthenticatorData);
@@ -7052,10 +7089,12 @@ var AuthenticatorEnrollmentData = function (_AuthenticatorData) {
7052
7089
  value: function mapAuthenticatorDataFromValues(data) {
7053
7090
  data = _get(_getPrototypeOf(AuthenticatorEnrollmentData.prototype), "mapAuthenticatorDataFromValues", this).call(this, data);
7054
7091
  var phoneNumber = _valuesInstanceProperty(this).phoneNumber;
7055
- data = _Object$assign(_Object$assign({}, data && data), phoneNumber && {
7092
+ if (!data && !phoneNumber) {
7093
+ return;
7094
+ }
7095
+ return _Object$assign(_Object$assign({}, data && data), phoneNumber && {
7056
7096
  phoneNumber: phoneNumber
7057
7097
  });
7058
- return data.phoneNumber && data.methodType ? data : null;
7059
7098
  }
7060
7099
  }]);
7061
7100
  return AuthenticatorEnrollmentData;
@@ -7068,18 +7107,13 @@ var Skip = function (_Remediator) {
7068
7107
  _inherits(Skip, _Remediator);
7069
7108
  var _super = _createSuper$1(Skip);
7070
7109
  function Skip() {
7071
- var _this;
7072
7110
  _classCallCheck(this, Skip);
7073
- _this = _super.apply(this, arguments);
7074
- _this.map = {
7075
- skip: ['skip']
7076
- };
7077
- return _this;
7111
+ return _super.apply(this, arguments);
7078
7112
  }
7079
7113
  _createClass(Skip, [{
7080
7114
  key: "canRemediate",
7081
7115
  value: function canRemediate() {
7082
- return !!_valuesInstanceProperty(this).skip;
7116
+ return !!_valuesInstanceProperty(this).skip || this.options.step === 'skip';
7083
7117
  }
7084
7118
  }]);
7085
7119
  return Skip;
@@ -7110,52 +7144,16 @@ var remediators = /*#__PURE__*/Object.freeze({
7110
7144
  });
7111
7145
 
7112
7146
  function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7113
- function _unsupportedIterableToArray$1(o, minLen) { var _context9; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = _sliceInstanceProperty(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
7147
+ function _unsupportedIterableToArray$1(o, minLen) { var _context11; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = _sliceInstanceProperty(_context11 = Object.prototype.toString.call(o)).call(_context11, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
7114
7148
  function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7115
- function getRemediator(idxRemediations, values, options) {
7116
- var remediators = options.remediators;
7117
- var remediator;
7118
- if (options.step) {
7119
- var remediation = _findInstanceProperty(idxRemediations).call(idxRemediations, function (_ref) {
7120
- var name = _ref.name;
7121
- return name === options.step;
7122
- });
7123
- var T = remediators[remediation.name];
7124
- return new T(remediation, values);
7125
- }
7126
- var remediatorCandidates = [];
7127
- var _iterator = _createForOfIteratorHelper$1(idxRemediations),
7128
- _step;
7129
- try {
7130
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
7131
- var _context;
7132
- var _remediation = _step.value;
7133
- var isRemeditionInFlow = _includesInstanceProperty(_context = _Object$keys(remediators)).call(_context, _remediation.name);
7134
- if (!isRemeditionInFlow) {
7135
- continue;
7136
- }
7137
- var _T = remediators[_remediation.name];
7138
- remediator = new _T(_remediation, values);
7139
- if (remediator.canRemediate()) {
7140
- return remediator;
7141
- }
7142
- remediatorCandidates.push(remediator);
7143
- }
7144
- } catch (err) {
7145
- _iterator.e(err);
7146
- } finally {
7147
- _iterator.f();
7148
- }
7149
- return remediatorCandidates[0];
7150
- }
7151
7149
  function isTerminalResponse(idxResponse) {
7152
7150
  var neededToProceed = idxResponse.neededToProceed,
7153
7151
  interactionCode = idxResponse.interactionCode;
7154
7152
  return !neededToProceed.length && !interactionCode;
7155
7153
  }
7156
7154
  function canSkipFn(idxResponse) {
7157
- return idxResponse.neededToProceed.some(function (_ref2) {
7158
- var name = _ref2.name;
7155
+ return idxResponse.neededToProceed.some(function (_ref) {
7156
+ var name = _ref.name;
7159
7157
  return name === 'skip';
7160
7158
  });
7161
7159
  }
@@ -7164,28 +7162,124 @@ function canResendFn(idxResponse) {
7164
7162
  return _includesInstanceProperty(actionName).call(actionName, 'resend');
7165
7163
  });
7166
7164
  }
7167
- function getIdxMessages(idxResponse) {
7168
- var _context2;
7165
+ function getMessagesFromIdxRemediationValue(value) {
7166
+ if (!value || !Array.isArray(value)) {
7167
+ return;
7168
+ }
7169
+ return _reduceInstanceProperty(value).call(value, function (messages, value) {
7170
+ if (value.messages) {
7171
+ var _context;
7172
+ messages = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(messages), _toConsumableArray(value.messages.value));
7173
+ }
7174
+ if (value.form) {
7175
+ var _context2;
7176
+ var messagesFromForm = getMessagesFromIdxRemediationValue(value.form.value) || [];
7177
+ messages = _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(messages), _toConsumableArray(messagesFromForm));
7178
+ }
7179
+ if (value.options) {
7180
+ var _context4;
7181
+ var optionValues = [];
7182
+ value.options.forEach(function (option) {
7183
+ var _context3;
7184
+ if (!option.value || typeof option.value === 'string') {
7185
+ return;
7186
+ }
7187
+ optionValues = _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(optionValues), [option.value]);
7188
+ });
7189
+ var messagesFromOptions = getMessagesFromIdxRemediationValue(optionValues) || [];
7190
+ messages = _concatInstanceProperty(_context4 = []).call(_context4, _toConsumableArray(messages), _toConsumableArray(messagesFromOptions));
7191
+ }
7192
+ return messages;
7193
+ }, []);
7194
+ }
7195
+ function getMessagesFromResponse(idxResponse) {
7196
+ var _context5;
7169
7197
  var _a;
7170
7198
  var messages = [];
7171
7199
  var rawIdxState = idxResponse.rawIdxState,
7172
7200
  neededToProceed = idxResponse.neededToProceed;
7173
- var globalMessages = (_a = rawIdxState.messages) === null || _a === void 0 ? void 0 : _mapInstanceProperty(_context2 = _a.value).call(_context2, function (message) {
7201
+ var globalMessages = (_a = rawIdxState.messages) === null || _a === void 0 ? void 0 : _mapInstanceProperty(_context5 = _a.value).call(_context5, function (message) {
7174
7202
  return message;
7175
7203
  });
7176
7204
  if (globalMessages) {
7177
- var _context3;
7178
- messages = _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(messages), _toConsumableArray(globalMessages));
7205
+ var _context6;
7206
+ messages = _concatInstanceProperty(_context6 = []).call(_context6, _toConsumableArray(messages), _toConsumableArray(globalMessages));
7179
7207
  }
7180
- var _iterator2 = _createForOfIteratorHelper$1(neededToProceed),
7208
+ var _iterator = _createForOfIteratorHelper$1(neededToProceed),
7209
+ _step;
7210
+ try {
7211
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
7212
+ var remediation = _step.value;
7213
+ var fieldMessages = getMessagesFromIdxRemediationValue(remediation.value);
7214
+ if (fieldMessages) {
7215
+ var _context8;
7216
+ messages = _concatInstanceProperty(_context8 = []).call(_context8, _toConsumableArray(messages), _toConsumableArray(fieldMessages));
7217
+ }
7218
+ }
7219
+ } catch (err) {
7220
+ _iterator.e(err);
7221
+ } finally {
7222
+ _iterator.f();
7223
+ }
7224
+ var seen = {};
7225
+ messages = _reduceInstanceProperty(messages).call(messages, function (filtered, message) {
7226
+ var _context7;
7227
+ var _a;
7228
+ var key = (_a = message.i18n) === null || _a === void 0 ? void 0 : _a.key;
7229
+ if (key && seen[key]) {
7230
+ return filtered;
7231
+ }
7232
+ seen[key] = message;
7233
+ filtered = _concatInstanceProperty(_context7 = []).call(_context7, _toConsumableArray(filtered), [message]);
7234
+ return filtered;
7235
+ }, []);
7236
+ return messages;
7237
+ }
7238
+ function getEnabledFeatures(idxResponse) {
7239
+ var res = [];
7240
+ var actions = idxResponse.actions,
7241
+ neededToProceed = idxResponse.neededToProceed;
7242
+ if (actions['currentAuthenticator-recover']) {
7243
+ res.push(IdxFeature.PASSWORD_RECOVERY);
7244
+ }
7245
+ if (neededToProceed.some(function (_ref2) {
7246
+ var name = _ref2.name;
7247
+ return name === 'select-enroll-profile';
7248
+ })) {
7249
+ res.push(IdxFeature.REGISTRATION);
7250
+ }
7251
+ if (neededToProceed.some(function (_ref3) {
7252
+ var name = _ref3.name;
7253
+ return name === 'redirect-idp';
7254
+ })) {
7255
+ res.push(IdxFeature.SOCIAL_IDP);
7256
+ }
7257
+ if (neededToProceed.some(function (_ref4) {
7258
+ var name = _ref4.name;
7259
+ return name === 'unlock-account';
7260
+ })) {
7261
+ res.push(IdxFeature.ACCOUNT_UNLOCK);
7262
+ }
7263
+ return res;
7264
+ }
7265
+ function getAvailableSteps(idxResponse) {
7266
+ var _context9;
7267
+ var res = [];
7268
+ var remediatorMap = _reduceInstanceProperty(_context9 = _Object$values(remediators)).call(_context9, function (map, remediatorClass) {
7269
+ if (remediatorClass.remediationName) {
7270
+ map[remediatorClass.remediationName] = remediatorClass;
7271
+ }
7272
+ return map;
7273
+ }, {});
7274
+ var _iterator2 = _createForOfIteratorHelper$1(idxResponse.neededToProceed),
7181
7275
  _step2;
7182
7276
  try {
7183
7277
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
7184
7278
  var remediation = _step2.value;
7185
- var fieldMessages = Remediator.getMessages(remediation);
7186
- if (fieldMessages) {
7187
- var _context4;
7188
- messages = _concatInstanceProperty(_context4 = []).call(_context4, _toConsumableArray(messages), _toConsumableArray(fieldMessages));
7279
+ var T = remediatorMap[remediation.name];
7280
+ if (T) {
7281
+ var remediator = new T(remediation);
7282
+ res.push(remediator.getNextStep(idxResponse.context));
7189
7283
  }
7190
7284
  }
7191
7285
  } catch (err) {
@@ -7193,7 +7287,61 @@ function getIdxMessages(idxResponse) {
7193
7287
  } finally {
7194
7288
  _iterator2.f();
7195
7289
  }
7196
- return messages;
7290
+ return res;
7291
+ }
7292
+ function filterValuesForRemediation(idxResponse, values) {
7293
+ var _context10;
7294
+ var valuesForRemediation = _reduceInstanceProperty(_context10 = idxResponse.neededToProceed[0].value).call(_context10, function (res, entry) {
7295
+ var name = entry.name;
7296
+ res[name] = values[name];
7297
+ return res;
7298
+ }, {});
7299
+ return valuesForRemediation;
7300
+ }
7301
+
7302
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7303
+ function _unsupportedIterableToArray(o, minLen) { var _context6; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context6 = Object.prototype.toString.call(o)).call(_context6, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7304
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7305
+ function getRemediator(idxRemediations, values, options) {
7306
+ var remediators = options.remediators;
7307
+ var remediator;
7308
+ if (options.step) {
7309
+ var remediation = _findInstanceProperty(idxRemediations).call(idxRemediations, function (_ref) {
7310
+ var name = _ref.name;
7311
+ return name === options.step;
7312
+ });
7313
+ if (remediation) {
7314
+ var T = remediation ? remediators[remediation.name] : undefined;
7315
+ return T ? new T(remediation, values, options) : undefined;
7316
+ } else {
7317
+ warn("step \"".concat(options.step, "\" did not match any remediations"));
7318
+ return;
7319
+ }
7320
+ }
7321
+ var remediatorCandidates = [];
7322
+ var _iterator = _createForOfIteratorHelper(idxRemediations),
7323
+ _step;
7324
+ try {
7325
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
7326
+ var _context;
7327
+ var _remediation = _step.value;
7328
+ var isRemeditionInFlow = _includesInstanceProperty(_context = _Object$keys(remediators)).call(_context, _remediation.name);
7329
+ if (!isRemeditionInFlow) {
7330
+ continue;
7331
+ }
7332
+ var _T = remediators[_remediation.name];
7333
+ remediator = new _T(_remediation, values, options);
7334
+ if (remediator.canRemediate()) {
7335
+ return remediator;
7336
+ }
7337
+ remediatorCandidates.push(remediator);
7338
+ }
7339
+ } catch (err) {
7340
+ _iterator.e(err);
7341
+ } finally {
7342
+ _iterator.f();
7343
+ }
7344
+ return remediatorCandidates[0];
7197
7345
  }
7198
7346
  function getNextStep(remediator, idxResponse) {
7199
7347
  var nextStep = remediator.getNextStep(idxResponse.context);
@@ -7206,20 +7354,23 @@ function getNextStep(remediator, idxResponse) {
7206
7354
  });
7207
7355
  }
7208
7356
  function handleIdxError(e, remediator) {
7209
- var idxState = isIdxResponse(e) ? e : null;
7210
- if (!idxState) {
7357
+ var idxResponse = isIdxResponse(e) ? e : null;
7358
+ if (!idxResponse) {
7211
7359
  throw e;
7212
7360
  }
7213
- var terminal = isTerminalResponse(idxState);
7214
- var messages = getIdxMessages(idxState);
7361
+ idxResponse.requestDidSucceed = false;
7362
+ var terminal = isTerminalResponse(idxResponse);
7363
+ var messages = getMessagesFromResponse(idxResponse);
7215
7364
  if (terminal) {
7216
7365
  return {
7366
+ idxResponse: idxResponse,
7217
7367
  terminal: terminal,
7218
7368
  messages: messages
7219
7369
  };
7220
7370
  } else {
7221
- var nextStep = remediator && getNextStep(remediator, idxState);
7371
+ var nextStep = remediator && getNextStep(remediator, idxResponse);
7222
7372
  return _Object$assign({
7373
+ idxResponse: idxResponse,
7223
7374
  messages: messages
7224
7375
  }, nextStep && {
7225
7376
  nextStep: nextStep
@@ -7227,8 +7378,8 @@ function handleIdxError(e, remediator) {
7227
7378
  }
7228
7379
  }
7229
7380
  function getActionFromValues(values, idxResponse) {
7230
- var _context5;
7231
- return _findInstanceProperty(_context5 = _Object$keys(idxResponse.actions)).call(_context5, function (action) {
7381
+ var _context2;
7382
+ return _findInstanceProperty(_context2 = _Object$keys(idxResponse.actions)).call(_context2, function (action) {
7232
7383
  return !!values.resend && _includesInstanceProperty(action).call(action, '-resend');
7233
7384
  });
7234
7385
  }
@@ -7241,198 +7392,230 @@ function remediate(_x, _x2, _x3) {
7241
7392
  }
7242
7393
  function _remediate() {
7243
7394
  _remediate = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(idxResponse, values, options) {
7244
- var _context6;
7245
- var _idxResponse, neededToProceed, interactionCode, remediators, flow, terminal, messages, actionFromValues, actions, _iterator3, _step3, _loop, _ret, remediator, nextStep, _nextStep, name, data;
7246
- return _regeneratorRuntime.wrap(function _callee$(_context8) {
7395
+ var _context3;
7396
+ var _idxResponse, neededToProceed, interactionCode, flow, terminal, messages, remediator, actionFromValues, actionFromOptions, actions, _iterator2, _step2, _loop, _ret, nextStep, _nextStep, name, data;
7397
+ return _regeneratorRuntime.wrap(function _callee$(_context5) {
7247
7398
  while (1) {
7248
- switch (_context8.prev = _context8.next) {
7399
+ switch (_context5.prev = _context5.next) {
7249
7400
  case 0:
7250
7401
  _idxResponse = idxResponse, neededToProceed = _idxResponse.neededToProceed, interactionCode = _idxResponse.interactionCode;
7251
- remediators = options.remediators, flow = options.flow;
7402
+ flow = options.flow;
7252
7403
  if (!interactionCode) {
7253
- _context8.next = 4;
7404
+ _context5.next = 4;
7254
7405
  break;
7255
7406
  }
7256
- return _context8.abrupt("return", {
7407
+ return _context5.abrupt("return", {
7257
7408
  idxResponse: idxResponse
7258
7409
  });
7259
7410
  case 4:
7260
7411
  terminal = isTerminalResponse(idxResponse);
7261
- messages = getIdxMessages(idxResponse);
7412
+ messages = getMessagesFromResponse(idxResponse);
7262
7413
  if (!terminal) {
7263
- _context8.next = 8;
7414
+ _context5.next = 8;
7264
7415
  break;
7265
7416
  }
7266
- return _context8.abrupt("return", {
7417
+ return _context5.abrupt("return", {
7418
+ idxResponse: idxResponse,
7267
7419
  terminal: terminal,
7268
7420
  messages: messages
7269
7421
  });
7270
7422
  case 8:
7423
+ remediator = getRemediator(neededToProceed, values, options);
7271
7424
  actionFromValues = getActionFromValues(values, idxResponse);
7272
- actions = _concatInstanceProperty(_context6 = []).call(_context6, _toConsumableArray(options.actions || []), _toConsumableArray(actionFromValues && [actionFromValues] || []));
7425
+ actionFromOptions = options.actions || [];
7426
+ actions = _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(actionFromOptions), _toConsumableArray(actionFromValues && [actionFromValues] || []));
7273
7427
  if (!actions) {
7274
- _context8.next = 30;
7428
+ _context5.next = 32;
7275
7429
  break;
7276
7430
  }
7277
- _iterator3 = _createForOfIteratorHelper$1(actions);
7278
- _context8.prev = 12;
7431
+ _iterator2 = _createForOfIteratorHelper(actions);
7432
+ _context5.prev = 14;
7279
7433
  _loop = _regeneratorRuntime.mark(function _loop() {
7280
- var action, valuesWithoutExecutedAction, remediationAction;
7281
- return _regeneratorRuntime.wrap(function _loop$(_context7) {
7434
+ var action, valuesWithoutExecutedAction, optionsWithoutExecutedAction, remediationAction;
7435
+ return _regeneratorRuntime.wrap(function _loop$(_context4) {
7282
7436
  while (1) {
7283
- switch (_context7.prev = _context7.next) {
7437
+ switch (_context4.prev = _context4.next) {
7284
7438
  case 0:
7285
- action = _step3.value;
7439
+ action = _step2.value;
7286
7440
  valuesWithoutExecutedAction = removeActionFromValues(values);
7441
+ optionsWithoutExecutedAction = _Object$assign(_Object$assign({}, options), {
7442
+ actions: _filterInstanceProperty(actionFromOptions).call(actionFromOptions, function (entry) {
7443
+ return entry !== action;
7444
+ })
7445
+ });
7287
7446
  if (!(typeof idxResponse.actions[action] === 'function')) {
7288
- _context7.next = 15;
7447
+ _context4.next = 17;
7289
7448
  break;
7290
7449
  }
7291
- _context7.prev = 3;
7292
- _context7.next = 6;
7450
+ _context4.prev = 4;
7451
+ _context4.next = 7;
7293
7452
  return idxResponse.actions[action]();
7294
- case 6:
7295
- idxResponse = _context7.sent;
7296
- _context7.next = 12;
7453
+ case 7:
7454
+ idxResponse = _context4.sent;
7455
+ idxResponse.requestDidSucceed = true;
7456
+ _context4.next = 14;
7297
7457
  break;
7298
- case 9:
7299
- _context7.prev = 9;
7300
- _context7.t0 = _context7["catch"](3);
7301
- return _context7.abrupt("return", {
7302
- v: handleIdxError(_context7.t0, remediators)
7458
+ case 11:
7459
+ _context4.prev = 11;
7460
+ _context4.t0 = _context4["catch"](4);
7461
+ return _context4.abrupt("return", {
7462
+ v: handleIdxError(_context4.t0, remediator)
7303
7463
  });
7304
- case 12:
7464
+ case 14:
7305
7465
  if (!(action === 'cancel')) {
7306
- _context7.next = 14;
7466
+ _context4.next = 16;
7307
7467
  break;
7308
7468
  }
7309
- return _context7.abrupt("return", {
7469
+ return _context4.abrupt("return", {
7310
7470
  v: {
7471
+ idxResponse: idxResponse,
7311
7472
  canceled: true
7312
7473
  }
7313
7474
  });
7314
- case 14:
7315
- return _context7.abrupt("return", {
7316
- v: remediate(idxResponse, valuesWithoutExecutedAction, options)
7475
+ case 16:
7476
+ return _context4.abrupt("return", {
7477
+ v: remediate(idxResponse, valuesWithoutExecutedAction, optionsWithoutExecutedAction)
7317
7478
  });
7318
- case 15:
7319
- remediationAction = _findInstanceProperty(neededToProceed).call(neededToProceed, function (_ref3) {
7320
- var name = _ref3.name;
7479
+ case 17:
7480
+ remediationAction = _findInstanceProperty(neededToProceed).call(neededToProceed, function (_ref2) {
7481
+ var name = _ref2.name;
7321
7482
  return name === action;
7322
7483
  });
7323
7484
  if (!remediationAction) {
7324
- _context7.next = 27;
7485
+ _context4.next = 30;
7325
7486
  break;
7326
7487
  }
7327
- _context7.prev = 17;
7328
- _context7.next = 20;
7488
+ _context4.prev = 19;
7489
+ _context4.next = 22;
7329
7490
  return idxResponse.proceed(action, {});
7330
- case 20:
7331
- idxResponse = _context7.sent;
7332
- _context7.next = 26;
7491
+ case 22:
7492
+ idxResponse = _context4.sent;
7493
+ idxResponse.requestDidSucceed = true;
7494
+ _context4.next = 29;
7333
7495
  break;
7334
- case 23:
7335
- _context7.prev = 23;
7336
- _context7.t1 = _context7["catch"](17);
7337
- return _context7.abrupt("return", {
7338
- v: handleIdxError(_context7.t1, remediators)
7339
- });
7340
7496
  case 26:
7341
- return _context7.abrupt("return", {
7342
- v: remediate(idxResponse, values, options)
7497
+ _context4.prev = 26;
7498
+ _context4.t1 = _context4["catch"](19);
7499
+ return _context4.abrupt("return", {
7500
+ v: handleIdxError(_context4.t1, remediator)
7343
7501
  });
7344
- case 27:
7502
+ case 29:
7503
+ return _context4.abrupt("return", {
7504
+ v: remediate(idxResponse, values, optionsWithoutExecutedAction)
7505
+ });
7506
+ case 30:
7345
7507
  case "end":
7346
- return _context7.stop();
7508
+ return _context4.stop();
7347
7509
  }
7348
7510
  }
7349
- }, _loop, null, [[3, 9], [17, 23]]);
7511
+ }, _loop, null, [[4, 11], [19, 26]]);
7350
7512
  });
7351
- _iterator3.s();
7352
- case 15:
7353
- if ((_step3 = _iterator3.n()).done) {
7354
- _context8.next = 22;
7513
+ _iterator2.s();
7514
+ case 17:
7515
+ if ((_step2 = _iterator2.n()).done) {
7516
+ _context5.next = 24;
7355
7517
  break;
7356
7518
  }
7357
- return _context8.delegateYield(_loop(), "t0", 17);
7358
- case 17:
7359
- _ret = _context8.t0;
7519
+ return _context5.delegateYield(_loop(), "t0", 19);
7520
+ case 19:
7521
+ _ret = _context5.t0;
7360
7522
  if (!(_typeof(_ret) === "object")) {
7361
- _context8.next = 20;
7523
+ _context5.next = 22;
7362
7524
  break;
7363
7525
  }
7364
- return _context8.abrupt("return", _ret.v);
7365
- case 20:
7366
- _context8.next = 15;
7367
- break;
7526
+ return _context5.abrupt("return", _ret.v);
7368
7527
  case 22:
7369
- _context8.next = 27;
7528
+ _context5.next = 17;
7370
7529
  break;
7371
7530
  case 24:
7372
- _context8.prev = 24;
7373
- _context8.t1 = _context8["catch"](12);
7374
- _iterator3.e(_context8.t1);
7375
- case 27:
7376
- _context8.prev = 27;
7377
- _iterator3.f();
7378
- return _context8.finish(27);
7379
- case 30:
7380
- remediator = getRemediator(neededToProceed, values, options);
7381
- if (!(!remediator && flow === 'default')) {
7382
- _context8.next = 33;
7531
+ _context5.next = 29;
7532
+ break;
7533
+ case 26:
7534
+ _context5.prev = 26;
7535
+ _context5.t1 = _context5["catch"](14);
7536
+ _iterator2.e(_context5.t1);
7537
+ case 29:
7538
+ _context5.prev = 29;
7539
+ _iterator2.f();
7540
+ return _context5.finish(29);
7541
+ case 32:
7542
+ if (remediator) {
7543
+ _context5.next = 49;
7383
7544
  break;
7384
7545
  }
7385
- return _context8.abrupt("return", {
7546
+ if (!options.step) {
7547
+ _context5.next = 46;
7548
+ break;
7549
+ }
7550
+ values = filterValuesForRemediation(idxResponse, values);
7551
+ _context5.prev = 35;
7552
+ _context5.next = 38;
7553
+ return idxResponse.proceed(options.step, values);
7554
+ case 38:
7555
+ idxResponse = _context5.sent;
7556
+ idxResponse.requestDidSucceed = true;
7557
+ return _context5.abrupt("return", {
7386
7558
  idxResponse: idxResponse
7387
7559
  });
7388
- case 33:
7389
- if (remediator) {
7390
- _context8.next = 35;
7560
+ case 43:
7561
+ _context5.prev = 43;
7562
+ _context5.t2 = _context5["catch"](35);
7563
+ return _context5.abrupt("return", handleIdxError(_context5.t2));
7564
+ case 46:
7565
+ if (!(flow === 'default')) {
7566
+ _context5.next = 48;
7391
7567
  break;
7392
7568
  }
7569
+ return _context5.abrupt("return", {
7570
+ idxResponse: idxResponse
7571
+ });
7572
+ case 48:
7393
7573
  throw new AuthSdkError("\n No remediation can match current flow, check policy settings in your org.\n Remediations: [".concat(_reduceInstanceProperty(neededToProceed).call(neededToProceed, function (acc, curr) {
7394
7574
  return acc ? acc + ' ,' + curr.name : curr.name;
7395
7575
  }, ''), "]\n "));
7396
- case 35:
7576
+ case 49:
7397
7577
  if (!messages.length) {
7398
- _context8.next = 38;
7578
+ _context5.next = 52;
7399
7579
  break;
7400
7580
  }
7401
7581
  nextStep = getNextStep(remediator, idxResponse);
7402
- return _context8.abrupt("return", {
7582
+ return _context5.abrupt("return", {
7583
+ idxResponse: idxResponse,
7403
7584
  nextStep: nextStep,
7404
7585
  messages: messages
7405
7586
  });
7406
- case 38:
7587
+ case 52:
7407
7588
  if (remediator.canRemediate()) {
7408
- _context8.next = 41;
7589
+ _context5.next = 55;
7409
7590
  break;
7410
7591
  }
7411
7592
  _nextStep = getNextStep(remediator, idxResponse);
7412
- return _context8.abrupt("return", {
7593
+ return _context5.abrupt("return", {
7413
7594
  idxResponse: idxResponse,
7414
7595
  nextStep: _nextStep
7415
7596
  });
7416
- case 41:
7597
+ case 55:
7417
7598
  name = remediator.getName();
7418
7599
  data = remediator.getData();
7419
- _context8.prev = 43;
7420
- _context8.next = 46;
7600
+ _context5.prev = 57;
7601
+ _context5.next = 60;
7421
7602
  return idxResponse.proceed(name, data);
7422
- case 46:
7423
- idxResponse = _context8.sent;
7603
+ case 60:
7604
+ idxResponse = _context5.sent;
7605
+ idxResponse.requestDidSucceed = true;
7424
7606
  values = remediator.getValuesAfterProceed();
7425
- return _context8.abrupt("return", remediate(idxResponse, values, options));
7426
- case 51:
7427
- _context8.prev = 51;
7428
- _context8.t2 = _context8["catch"](43);
7429
- return _context8.abrupt("return", handleIdxError(_context8.t2, remediator));
7430
- case 54:
7607
+ delete options.step;
7608
+ return _context5.abrupt("return", remediate(idxResponse, values, options));
7609
+ case 67:
7610
+ _context5.prev = 67;
7611
+ _context5.t3 = _context5["catch"](57);
7612
+ return _context5.abrupt("return", handleIdxError(_context5.t3, remediator));
7613
+ case 70:
7431
7614
  case "end":
7432
- return _context8.stop();
7615
+ return _context5.stop();
7433
7616
  }
7434
7617
  }
7435
- }, _callee, null, [[12, 24, 27, 30], [43, 51]]);
7618
+ }, _callee, null, [[14, 26, 29, 32], [35, 43], [57, 67]]);
7436
7619
  }));
7437
7620
  return _remediate.apply(this, arguments);
7438
7621
  }
@@ -7526,148 +7709,78 @@ function getFlowSpecification(oktaAuth) {
7526
7709
  };
7527
7710
  }
7528
7711
 
7529
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7530
- function _unsupportedIterableToArray(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7531
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7532
- function getEnabledFeatures(idxResponse) {
7533
- var res = [];
7534
- var actions = idxResponse.actions,
7535
- neededToProceed = idxResponse.neededToProceed;
7536
- if (actions['currentAuthenticator-recover']) {
7537
- res.push(IdxFeature.PASSWORD_RECOVERY);
7538
- }
7539
- if (neededToProceed.some(function (_ref) {
7540
- var name = _ref.name;
7541
- return name === 'select-enroll-profile';
7542
- })) {
7543
- res.push(IdxFeature.REGISTRATION);
7544
- }
7545
- if (neededToProceed.some(function (_ref2) {
7546
- var name = _ref2.name;
7547
- return name === 'redirect-idp';
7548
- })) {
7549
- res.push(IdxFeature.SOCIAL_IDP);
7550
- }
7551
- if (neededToProceed.some(function (_ref3) {
7552
- var name = _ref3.name;
7553
- return name === 'unlock-account';
7554
- })) {
7555
- res.push(IdxFeature.ACCOUNT_UNLOCK);
7556
- }
7557
- return res;
7712
+ function initializeValues(options) {
7713
+ var knownOptions = ['flow', 'remediators', 'actions', 'withCredentials', 'step'];
7714
+ var values = _Object$assign({}, options);
7715
+ knownOptions.forEach(function (option) {
7716
+ delete values[option];
7717
+ });
7718
+ return values;
7558
7719
  }
7559
- function getAvailableSteps(idxResponse) {
7560
- var _context;
7561
- var res = [];
7562
- var remediatorMap = _reduceInstanceProperty(_context = _Object$values(remediators)).call(_context, function (map, remediatorClass) {
7563
- if (remediatorClass.remediationName) {
7564
- map[remediatorClass.remediationName] = remediatorClass;
7565
- }
7566
- return map;
7567
- }, {});
7568
- var _iterator = _createForOfIteratorHelper(idxResponse.neededToProceed),
7569
- _step;
7570
- try {
7571
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
7572
- var remediation = _step.value;
7573
- var T = remediatorMap[remediation.name];
7574
- if (T) {
7575
- var remediator = new T(remediation);
7576
- res.push(remediator.getNextStep(idxResponse.context));
7577
- }
7578
- }
7579
- } catch (err) {
7580
- _iterator.e(err);
7581
- } finally {
7582
- _iterator.f();
7583
- }
7584
- return res;
7720
+ function initializeData(authClient, data) {
7721
+ var options = data.options;
7722
+ var flow = options.flow,
7723
+ withCredentials = options.withCredentials,
7724
+ remediators = options.remediators,
7725
+ actions = options.actions;
7726
+ var status = IdxStatus.PENDING;
7727
+ flow = flow || authClient.idx.getFlow() || 'default';
7728
+ if (flow) {
7729
+ authClient.idx.setFlow(flow);
7730
+ var flowSpec = getFlowSpecification(authClient, flow);
7731
+ withCredentials = typeof withCredentials !== 'undefined' ? withCredentials : flowSpec.withCredentials;
7732
+ remediators = remediators || flowSpec.remediators;
7733
+ actions = actions || flowSpec.actions;
7734
+ }
7735
+ return _Object$assign(_Object$assign({}, data), {
7736
+ options: _Object$assign(_Object$assign({}, options), {
7737
+ flow: flow,
7738
+ withCredentials: withCredentials,
7739
+ remediators: remediators,
7740
+ actions: actions
7741
+ }),
7742
+ status: status
7743
+ });
7585
7744
  }
7586
- function run(_x) {
7587
- return _run.apply(this, arguments);
7745
+ function getDataFromIntrospect(_x, _x2) {
7746
+ return _getDataFromIntrospect.apply(this, arguments);
7588
7747
  }
7589
- function _run() {
7590
- _run = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(authClient) {
7591
- var options,
7592
- tokens,
7593
- nextStep,
7594
- messages,
7595
- error,
7596
- meta,
7597
- enabledFeatures,
7598
- availableSteps,
7599
- status,
7600
- shouldClearTransaction,
7601
- clearSharedStorage,
7602
- idxResponse,
7603
- interactionHandle,
7604
- metaFromResp,
7605
- interactionCode,
7606
- flow,
7607
- state,
7608
- scopes,
7609
- version,
7610
- _remediators,
7611
- _actions,
7612
- withCredentials,
7613
- exchangeCodeForTokens,
7614
- autoRemediate,
7615
- step,
7616
- recoveryToken,
7617
- activationToken,
7618
- flowSpec,
7619
- interactResponse,
7620
- values,
7621
- _yield$remediate,
7622
- idxResponseFromResp,
7623
- nextStepFromResp,
7624
- terminal,
7625
- canceled,
7626
- messagesFromResp,
7627
- _metaFromResp,
7628
- clientId,
7629
- codeVerifier,
7630
- ignoreSignature,
7631
- redirectUri,
7632
- urls,
7633
- _scopes,
7634
- _ref4,
7635
- actions,
7636
- context,
7637
- neededToProceed,
7638
- proceed,
7639
- rawIdxState,
7640
- _args = arguments;
7641
- return _regeneratorRuntime.wrap(function _callee$(_context2) {
7748
+ function _getDataFromIntrospect() {
7749
+ _getDataFromIntrospect = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(authClient, data) {
7750
+ var options, stateHandle, withCredentials, version, state, scopes, recoveryToken, activationToken, idxResponse, meta, interactionHandle, interactResponse;
7751
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
7642
7752
  while (1) {
7643
- switch (_context2.prev = _context2.next) {
7753
+ switch (_context.prev = _context.next) {
7644
7754
  case 0:
7645
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
7646
- status = IdxStatus.PENDING;
7647
- shouldClearTransaction = false;
7648
- clearSharedStorage = true;
7649
- _context2.prev = 4;
7650
- flow = options.flow, state = options.state, scopes = options.scopes, version = options.version, _remediators = options.remediators, _actions = options.actions, withCredentials = options.withCredentials, exchangeCodeForTokens = options.exchangeCodeForTokens, autoRemediate = options.autoRemediate, step = options.step, recoveryToken = options.recoveryToken, activationToken = options.activationToken;
7651
- flow = flow || authClient.idx.getFlow() || 'default';
7652
- if (flow) {
7653
- authClient.idx.setFlow(flow);
7654
- flowSpec = getFlowSpecification(authClient, flow);
7655
- withCredentials = typeof withCredentials !== 'undefined' ? withCredentials : flowSpec.withCredentials;
7656
- _remediators = _remediators || flowSpec.remediators;
7657
- _actions = _actions || flowSpec.actions;
7755
+ options = data.options;
7756
+ stateHandle = options.stateHandle, withCredentials = options.withCredentials, version = options.version, state = options.state, scopes = options.scopes, recoveryToken = options.recoveryToken, activationToken = options.activationToken;
7757
+ if (!stateHandle) {
7758
+ _context.next = 8;
7759
+ break;
7658
7760
  }
7659
- metaFromResp = getSavedTransactionMeta(authClient, {
7761
+ _context.next = 5;
7762
+ return introspect(authClient, {
7763
+ withCredentials: withCredentials,
7764
+ version: version,
7765
+ stateHandle: stateHandle
7766
+ });
7767
+ case 5:
7768
+ idxResponse = _context.sent;
7769
+ _context.next = 20;
7770
+ break;
7771
+ case 8:
7772
+ meta = getSavedTransactionMeta(authClient, {
7660
7773
  state: state,
7661
7774
  recoveryToken: recoveryToken,
7662
7775
  activationToken: activationToken
7663
7776
  });
7664
- interactionHandle = metaFromResp === null || metaFromResp === void 0 ? void 0 : metaFromResp.interactionHandle;
7777
+ interactionHandle = meta === null || meta === void 0 ? void 0 : meta.interactionHandle;
7665
7778
  if (interactionHandle) {
7666
- _context2.next = 18;
7779
+ _context.next = 17;
7667
7780
  break;
7668
7781
  }
7669
7782
  authClient.transactionManager.clear();
7670
- _context2.next = 14;
7783
+ _context.next = 14;
7671
7784
  return interact(authClient, {
7672
7785
  withCredentials: withCredentials,
7673
7786
  state: state,
@@ -7676,119 +7789,288 @@ function _run() {
7676
7789
  recoveryToken: recoveryToken
7677
7790
  });
7678
7791
  case 14:
7679
- interactResponse = _context2.sent;
7792
+ interactResponse = _context.sent;
7680
7793
  interactionHandle = interactResponse.interactionHandle;
7681
- metaFromResp = interactResponse.meta;
7682
- withCredentials = metaFromResp.withCredentials;
7683
- case 18:
7684
- _context2.next = 20;
7794
+ meta = interactResponse.meta;
7795
+ case 17:
7796
+ _context.next = 19;
7685
7797
  return introspect(authClient, {
7686
7798
  withCredentials: withCredentials,
7687
7799
  version: version,
7688
7800
  interactionHandle: interactionHandle
7689
7801
  });
7802
+ case 19:
7803
+ idxResponse = _context.sent;
7690
7804
  case 20:
7691
- idxResponse = _context2.sent;
7692
- enabledFeatures = getEnabledFeatures(idxResponse);
7693
- availableSteps = getAvailableSteps(idxResponse);
7694
- meta = metaFromResp;
7695
- if (!(autoRemediate !== false && (_remediators || _actions))) {
7696
- _context2.next = 57;
7805
+ return _context.abrupt("return", _Object$assign(_Object$assign({}, data), {
7806
+ idxResponse: idxResponse,
7807
+ meta: meta
7808
+ }));
7809
+ case 21:
7810
+ case "end":
7811
+ return _context.stop();
7812
+ }
7813
+ }
7814
+ }, _callee);
7815
+ }));
7816
+ return _getDataFromIntrospect.apply(this, arguments);
7817
+ }
7818
+ function getDataFromRemediate(_x3) {
7819
+ return _getDataFromRemediate.apply(this, arguments);
7820
+ }
7821
+ function _getDataFromRemediate() {
7822
+ _getDataFromRemediate = _asyncToGenerator( _regeneratorRuntime.mark(function _callee2(data) {
7823
+ var idxResponse, options, values, autoRemediate, remediators, actions, flow, step, shouldRemediate, _yield$remediate, idxResponseFromRemediation, nextStep, canceled;
7824
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
7825
+ while (1) {
7826
+ switch (_context2.prev = _context2.next) {
7827
+ case 0:
7828
+ idxResponse = data.idxResponse, options = data.options, values = _valuesInstanceProperty(data);
7829
+ autoRemediate = options.autoRemediate, remediators = options.remediators, actions = options.actions, flow = options.flow, step = options.step;
7830
+ shouldRemediate = autoRemediate !== false && (remediators || actions || step);
7831
+ if (shouldRemediate) {
7832
+ _context2.next = 5;
7697
7833
  break;
7698
7834
  }
7699
- values = _Object$assign(_Object$assign({}, options), {
7835
+ return _context2.abrupt("return", data);
7836
+ case 5:
7837
+ values = _Object$assign(_Object$assign({}, values), {
7700
7838
  stateHandle: idxResponse.rawIdxState.stateHandle
7701
7839
  });
7702
- _context2.next = 28;
7840
+ _context2.next = 8;
7703
7841
  return remediate(idxResponse, values, {
7704
- remediators: _remediators,
7705
- actions: _actions,
7842
+ remediators: remediators,
7843
+ actions: actions,
7706
7844
  flow: flow,
7707
7845
  step: step
7708
7846
  });
7709
- case 28:
7847
+ case 8:
7710
7848
  _yield$remediate = _context2.sent;
7711
- idxResponseFromResp = _yield$remediate.idxResponse;
7712
- nextStepFromResp = _yield$remediate.nextStep;
7713
- terminal = _yield$remediate.terminal;
7849
+ idxResponseFromRemediation = _yield$remediate.idxResponse;
7850
+ nextStep = _yield$remediate.nextStep;
7714
7851
  canceled = _yield$remediate.canceled;
7715
- messagesFromResp = _yield$remediate.messages;
7716
- idxResponse = idxResponseFromResp || idxResponse;
7717
- nextStep = nextStepFromResp;
7718
- messages = messagesFromResp;
7719
- if (nextStep) {
7720
- authClient.transactionManager.saveIdxResponse(idxResponse.rawIdxState);
7852
+ idxResponse = idxResponseFromRemediation;
7853
+ return _context2.abrupt("return", _Object$assign(_Object$assign({}, data), {
7854
+ idxResponse: idxResponse,
7855
+ nextStep: nextStep,
7856
+ canceled: canceled
7857
+ }));
7858
+ case 14:
7859
+ case "end":
7860
+ return _context2.stop();
7861
+ }
7862
+ }
7863
+ }, _callee2);
7864
+ }));
7865
+ return _getDataFromRemediate.apply(this, arguments);
7866
+ }
7867
+ function getTokens(_x4, _x5) {
7868
+ return _getTokens.apply(this, arguments);
7869
+ }
7870
+ function _getTokens() {
7871
+ _getTokens = _asyncToGenerator( _regeneratorRuntime.mark(function _callee3(authClient, data) {
7872
+ var meta, idxResponse, interactionCode, clientId, codeVerifier, ignoreSignature, redirectUri, urls, scopes, tokenResponse;
7873
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
7874
+ while (1) {
7875
+ switch (_context3.prev = _context3.next) {
7876
+ case 0:
7877
+ meta = data.meta, idxResponse = data.idxResponse;
7878
+ interactionCode = idxResponse.interactionCode;
7879
+ clientId = meta.clientId, codeVerifier = meta.codeVerifier, ignoreSignature = meta.ignoreSignature, redirectUri = meta.redirectUri, urls = meta.urls, scopes = meta.scopes;
7880
+ _context3.next = 5;
7881
+ return authClient.token.exchangeCodeForTokens({
7882
+ interactionCode: interactionCode,
7883
+ clientId: clientId,
7884
+ codeVerifier: codeVerifier,
7885
+ ignoreSignature: ignoreSignature,
7886
+ redirectUri: redirectUri,
7887
+ scopes: scopes
7888
+ }, urls);
7889
+ case 5:
7890
+ tokenResponse = _context3.sent;
7891
+ return _context3.abrupt("return", tokenResponse.tokens);
7892
+ case 7:
7893
+ case "end":
7894
+ return _context3.stop();
7895
+ }
7896
+ }
7897
+ }, _callee3);
7898
+ }));
7899
+ return _getTokens.apply(this, arguments);
7900
+ }
7901
+ function finalizeData(_x6, _x7) {
7902
+ return _finalizeData.apply(this, arguments);
7903
+ }
7904
+ function _finalizeData() {
7905
+ _finalizeData = _asyncToGenerator( _regeneratorRuntime.mark(function _callee4(authClient, data) {
7906
+ var options, idxResponse, canceled, status, exchangeCodeForTokens, shouldClearTransaction, clearSharedStorage, interactionCode, tokens, enabledFeatures, availableSteps, messages, terminal;
7907
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
7908
+ while (1) {
7909
+ switch (_context4.prev = _context4.next) {
7910
+ case 0:
7911
+ options = data.options, idxResponse = data.idxResponse, canceled = data.canceled, status = data.status;
7912
+ exchangeCodeForTokens = options.exchangeCodeForTokens;
7913
+ shouldClearTransaction = false;
7914
+ clearSharedStorage = true;
7915
+ if (idxResponse) {
7916
+ enabledFeatures = getEnabledFeatures(idxResponse);
7721
7917
  availableSteps = getAvailableSteps(idxResponse);
7918
+ messages = getMessagesFromResponse(idxResponse);
7919
+ terminal = isTerminalResponse(idxResponse);
7722
7920
  }
7723
- if (terminal) {
7724
- status = IdxStatus.TERMINAL;
7725
- shouldClearTransaction = true;
7726
- clearSharedStorage = false;
7921
+ if (!terminal) {
7922
+ _context4.next = 11;
7923
+ break;
7727
7924
  }
7925
+ status = IdxStatus.TERMINAL;
7926
+ shouldClearTransaction = true;
7927
+ clearSharedStorage = false;
7928
+ _context4.next = 28;
7929
+ break;
7930
+ case 11:
7728
7931
  if (!canceled) {
7729
- _context2.next = 44;
7932
+ _context4.next = 16;
7730
7933
  break;
7731
7934
  }
7732
7935
  status = IdxStatus.CANCELED;
7733
7936
  shouldClearTransaction = true;
7734
- _context2.next = 57;
7937
+ _context4.next = 28;
7735
7938
  break;
7736
- case 44:
7939
+ case 16:
7737
7940
  if (!(idxResponse === null || idxResponse === void 0 ? void 0 : idxResponse.interactionCode)) {
7738
- _context2.next = 57;
7941
+ _context4.next = 28;
7739
7942
  break;
7740
7943
  }
7741
7944
  interactionCode = idxResponse.interactionCode;
7742
7945
  if (!(exchangeCodeForTokens === false)) {
7743
- _context2.next = 51;
7946
+ _context4.next = 23;
7744
7947
  break;
7745
7948
  }
7746
7949
  status = IdxStatus.SUCCESS;
7747
7950
  shouldClearTransaction = false;
7748
- _context2.next = 57;
7951
+ _context4.next = 28;
7749
7952
  break;
7750
- case 51:
7751
- _metaFromResp = metaFromResp, clientId = _metaFromResp.clientId, codeVerifier = _metaFromResp.codeVerifier, ignoreSignature = _metaFromResp.ignoreSignature, redirectUri = _metaFromResp.redirectUri, urls = _metaFromResp.urls, _scopes = _metaFromResp.scopes;
7752
- _context2.next = 54;
7753
- return authClient.token.exchangeCodeForTokens({
7754
- interactionCode: interactionCode,
7755
- clientId: clientId,
7756
- codeVerifier: codeVerifier,
7757
- ignoreSignature: ignoreSignature,
7758
- redirectUri: redirectUri,
7759
- scopes: _scopes
7760
- }, urls);
7761
- case 54:
7762
- tokens = _context2.sent;
7953
+ case 23:
7954
+ _context4.next = 25;
7955
+ return getTokens(authClient, data);
7956
+ case 25:
7957
+ tokens = _context4.sent;
7763
7958
  status = IdxStatus.SUCCESS;
7764
7959
  shouldClearTransaction = true;
7765
- case 57:
7766
- _context2.next = 68;
7767
- break;
7768
- case 59:
7769
- _context2.prev = 59;
7770
- _context2.t0 = _context2["catch"](4);
7771
- if (!isIdxResponse(_context2.t0)) {
7772
- _context2.next = 67;
7773
- break;
7774
- }
7775
- error = _context2.t0;
7776
- status = IdxStatus.FAILURE;
7777
- shouldClearTransaction = true;
7778
- _context2.next = 68;
7960
+ case 28:
7961
+ return _context4.abrupt("return", _Object$assign(_Object$assign({}, data), {
7962
+ status: status,
7963
+ interactionCode: interactionCode,
7964
+ tokens: tokens,
7965
+ shouldClearTransaction: shouldClearTransaction,
7966
+ clearSharedStorage: clearSharedStorage,
7967
+ enabledFeatures: enabledFeatures,
7968
+ availableSteps: availableSteps,
7969
+ messages: messages,
7970
+ terminal: terminal
7971
+ }));
7972
+ case 29:
7973
+ case "end":
7974
+ return _context4.stop();
7975
+ }
7976
+ }
7977
+ }, _callee4);
7978
+ }));
7979
+ return _finalizeData.apply(this, arguments);
7980
+ }
7981
+ function handleError(err, data) {
7982
+ var error = data.error,
7983
+ status = data.status,
7984
+ shouldClearTransaction = data.shouldClearTransaction;
7985
+ if (isIdxResponse(err)) {
7986
+ error = err;
7987
+ status = IdxStatus.FAILURE;
7988
+ shouldClearTransaction = true;
7989
+ } else {
7990
+ throw err;
7991
+ }
7992
+ return _Object$assign(_Object$assign({}, data), {
7993
+ error: error,
7994
+ status: status,
7995
+ shouldClearTransaction: shouldClearTransaction
7996
+ });
7997
+ }
7998
+ function run(_x8) {
7999
+ return _run.apply(this, arguments);
8000
+ }
8001
+ function _run() {
8002
+ _run = _asyncToGenerator( _regeneratorRuntime.mark(function _callee5(authClient) {
8003
+ var options,
8004
+ data,
8005
+ _data,
8006
+ idxResponse,
8007
+ meta,
8008
+ shouldClearTransaction,
8009
+ clearSharedStorage,
8010
+ status,
8011
+ enabledFeatures,
8012
+ availableSteps,
8013
+ tokens,
8014
+ nextStep,
8015
+ messages,
8016
+ error,
8017
+ interactionCode,
8018
+ rawIdxResponse,
8019
+ requestDidSucceed,
8020
+ _ref,
8021
+ actions,
8022
+ context,
8023
+ neededToProceed,
8024
+ proceed,
8025
+ rawIdxState,
8026
+ _args5 = arguments;
8027
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
8028
+ while (1) {
8029
+ switch (_context5.prev = _context5.next) {
8030
+ case 0:
8031
+ options = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
8032
+ data = {
8033
+ options: options,
8034
+ values: initializeValues(options)
8035
+ };
8036
+ data = initializeData(authClient, data);
8037
+ _context5.prev = 3;
8038
+ _context5.next = 6;
8039
+ return getDataFromIntrospect(authClient, data);
8040
+ case 6:
8041
+ data = _context5.sent;
8042
+ _context5.next = 9;
8043
+ return getDataFromRemediate(data);
8044
+ case 9:
8045
+ data = _context5.sent;
8046
+ _context5.next = 15;
7779
8047
  break;
7780
- case 67:
7781
- throw _context2.t0;
7782
- case 68:
8048
+ case 12:
8049
+ _context5.prev = 12;
8050
+ _context5.t0 = _context5["catch"](3);
8051
+ data = handleError(_context5.t0, data);
8052
+ case 15:
8053
+ _context5.next = 17;
8054
+ return finalizeData(authClient, data);
8055
+ case 17:
8056
+ data = _context5.sent;
8057
+ _data = data, idxResponse = _data.idxResponse, meta = _data.meta, shouldClearTransaction = _data.shouldClearTransaction, clearSharedStorage = _data.clearSharedStorage, status = _data.status, enabledFeatures = _data.enabledFeatures, availableSteps = _data.availableSteps, tokens = _data.tokens, nextStep = _data.nextStep, messages = _data.messages, error = _data.error, interactionCode = _data.interactionCode;
7783
8058
  if (shouldClearTransaction) {
7784
8059
  authClient.transactionManager.clear({
7785
8060
  clearSharedStorage: clearSharedStorage
7786
8061
  });
7787
- } else if (meta === null || meta === void 0 ? void 0 : meta.state) {
8062
+ } else {
7788
8063
  saveTransactionMeta(authClient, _Object$assign({}, meta));
8064
+ if (idxResponse) {
8065
+ rawIdxResponse = idxResponse.rawIdxState, requestDidSucceed = idxResponse.requestDidSucceed;
8066
+ authClient.transactionManager.saveIdxResponse({
8067
+ rawIdxResponse: rawIdxResponse,
8068
+ requestDidSucceed: requestDidSucceed
8069
+ });
8070
+ }
7789
8071
  }
7790
- _ref4 = idxResponse || {}, actions = _ref4.actions, context = _ref4.context, neededToProceed = _ref4.neededToProceed, proceed = _ref4.proceed, rawIdxState = _ref4.rawIdxState;
7791
- return _context2.abrupt("return", _Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign({
8072
+ _ref = idxResponse || {}, actions = _ref.actions, context = _ref.context, neededToProceed = _ref.neededToProceed, proceed = _ref.proceed, rawIdxState = _ref.rawIdxState;
8073
+ return _context5.abrupt("return", _Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign(_Object$assign({
7792
8074
  status: status
7793
8075
  }, meta && {
7794
8076
  meta: meta
@@ -7797,10 +8079,10 @@ function _run() {
7797
8079
  }), availableSteps && {
7798
8080
  availableSteps: availableSteps
7799
8081
  }), tokens && {
7800
- tokens: tokens.tokens
8082
+ tokens: tokens
7801
8083
  }), nextStep && {
7802
8084
  nextStep: nextStep
7803
- }), messages && {
8085
+ }), messages && messages.length && {
7804
8086
  messages: messages
7805
8087
  }), error && {
7806
8088
  error: error
@@ -7812,12 +8094,12 @@ function _run() {
7812
8094
  proceed: proceed,
7813
8095
  rawIdxState: rawIdxState
7814
8096
  }));
7815
- case 71:
8097
+ case 22:
7816
8098
  case "end":
7817
- return _context2.stop();
8099
+ return _context5.stop();
7818
8100
  }
7819
8101
  }
7820
- }, _callee, null, [[4, 59]]);
8102
+ }, _callee5, null, [[3, 12]]);
7821
8103
  }));
7822
8104
  return _run.apply(this, arguments);
7823
8105
  }
@@ -7940,9 +8222,10 @@ function _handleEmailVerifyCallback() {
7940
8222
  return _handleEmailVerifyCallback.apply(this, arguments);
7941
8223
  }
7942
8224
 
7943
- function canProceed(authClient, options) {
8225
+ function canProceed(authClient) {
8226
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7944
8227
  var meta = getSavedTransactionMeta(authClient, options);
7945
- return !!meta;
8228
+ return !!(meta || options.stateHandle);
7946
8229
  }
7947
8230
  function proceed(_x) {
7948
8231
  return _proceed.apply(this, arguments);
@@ -7950,30 +8233,32 @@ function proceed(_x) {
7950
8233
  function _proceed() {
7951
8234
  _proceed = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(authClient) {
7952
8235
  var options,
8236
+ flow,
7953
8237
  state,
7954
8238
  meta,
7955
- flow,
7956
8239
  _args = arguments;
7957
8240
  return _regeneratorRuntime.wrap(function _callee$(_context) {
7958
8241
  while (1) {
7959
8242
  switch (_context.prev = _context.next) {
7960
8243
  case 0:
7961
8244
  options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
7962
- state = options.state;
7963
- meta = getSavedTransactionMeta(authClient, {
7964
- state: state
7965
- });
7966
- if (meta) {
7967
- _context.next = 5;
8245
+ if (canProceed(authClient, options)) {
8246
+ _context.next = 3;
7968
8247
  break;
7969
8248
  }
7970
8249
  throw new AuthSdkError('Unable to proceed: saved transaction could not be loaded');
7971
- case 5:
7972
- flow = meta === null || meta === void 0 ? void 0 : meta.flow;
8250
+ case 3:
8251
+ flow = options.flow, state = options.state;
8252
+ if (!flow) {
8253
+ meta = getSavedTransactionMeta(authClient, {
8254
+ state: state
8255
+ });
8256
+ flow = meta === null || meta === void 0 ? void 0 : meta.flow;
8257
+ }
7973
8258
  return _context.abrupt("return", run(authClient, _Object$assign(_Object$assign({}, options), {
7974
8259
  flow: flow
7975
8260
  })));
7976
- case 7:
8261
+ case 6:
7977
8262
  case "end":
7978
8263
  return _context.stop();
7979
8264
  }
@@ -8171,7 +8456,7 @@ function handleInteractionCodeRedirect(_x, _x2) {
8171
8456
  }
8172
8457
  function _handleInteractionCodeRedirect() {
8173
8458
  _handleInteractionCodeRedirect = _asyncToGenerator( _regeneratorRuntime.mark(function _callee(authClient, url) {
8174
- var meta, codeVerifier, savedState, _URL$1, searchParams, state, interactionCode, error, _yield$authClient$tok, tokens;
8459
+ var meta, codeVerifier, savedState, _URL, searchParams, state, interactionCode, error, _yield$authClient$tok, tokens;
8175
8460
  return _regeneratorRuntime.wrap(function _callee$(_context) {
8176
8461
  while (1) {
8177
8462
  switch (_context.prev = _context.next) {
@@ -8184,7 +8469,7 @@ function _handleInteractionCodeRedirect() {
8184
8469
  throw new AuthSdkError('No transaction data was found in storage');
8185
8470
  case 3:
8186
8471
  codeVerifier = meta.codeVerifier, savedState = meta.state;
8187
- _URL$1 = new _URL(url), searchParams = _URL$1.searchParams;
8472
+ _URL = new _URL2(url), searchParams = _URL.searchParams;
8188
8473
  state = searchParams.get('state');
8189
8474
  interactionCode = searchParams.get('interaction_code');
8190
8475
  error = searchParams.get('error');
@@ -8287,7 +8572,7 @@ function createGlobalRequestInterceptor(sdk) {
8287
8572
  var OktaUserAgent = function () {
8288
8573
  function OktaUserAgent() {
8289
8574
  _classCallCheck(this, OktaUserAgent);
8290
- this.environments = ["okta-auth-js/".concat("6.2.0")];
8575
+ this.environments = ["okta-auth-js/".concat("6.3.2")];
8291
8576
  }
8292
8577
  _createClass(OktaUserAgent, [{
8293
8578
  key: "addEnvironment",
@@ -8305,7 +8590,7 @@ var OktaUserAgent = function () {
8305
8590
  }, {
8306
8591
  key: "getVersion",
8307
8592
  value: function getVersion() {
8308
- return "6.2.0";
8593
+ return "6.3.2";
8309
8594
  }
8310
8595
  }, {
8311
8596
  key: "maybeAddNodeEnvironment",
@@ -9172,5 +9457,5 @@ _Object$assign(OktaAuth, {
9172
9457
  constants: constants
9173
9458
  });
9174
9459
 
9175
- export { ACCESS_TOKEN_STORAGE_KEY, AuthApiError, AuthPollStopError, AuthSdkError, AuthStateManager, AuthTransaction, AuthenticatorKey, CACHE_STORAGE_NAME, DEFAULT_CACHE_DURATION, DEFAULT_CODE_CHALLENGE_METHOD, DEFAULT_MAX_CLOCK_SKEW, DEFAULT_POLLING_DELAY, EVENT_ADDED, EVENT_ERROR, EVENT_EXPIRED, EVENT_REMOVED, EVENT_RENEWED, IDX_API_VERSION, IDX_RESPONSE_STORAGE_NAME, ID_TOKEN_STORAGE_KEY, INITIAL_AUTH_STATE, IdxFeature, IdxStatus, MAX_VERIFIER_LENGTH, MIN_VERIFIER_LENGTH, OAuthError, ORIGINAL_URI_STORAGE_NAME, OktaAuth, PKCE_STORAGE_NAME, REDIRECT_NONCE_COOKIE_NAME, REDIRECT_OAUTH_PARAMS_NAME, REDIRECT_STATE_COOKIE_NAME, REFERRER_PATH_STORAGE_KEY, REFRESH_TOKEN_STORAGE_KEY, SHARED_TRANSACTION_STORAGE_NAME, STATE_TOKEN_KEY_NAME, StorageManager, TOKEN_STORAGE_NAME, TRANSACTION_STORAGE_NAME, TokenManager, addListener, addPostMessageListener, addStateToken, assertPKCESupport, authenticate, bind, buildAuthorizeParams, canProceed, cancel, clearTransactionMeta, clone, convertTokenParamsToOAuthParams, createOAuthMeta, createTransactionMeta, crypto$1 as crypto, decodeToken, delay, deprecate, deprecateWrap, exchangeCodeForTokens, extend, find, genRandomString, generateNonce, generateState, getConsole, getDefaultTokenParams, getHashOrSearch, getKey, getLink, getNativeConsole, getOAuthBaseUrl, getOAuthDomain, getOAuthUrls, getPollFn, getSavedTransactionMeta, getStateToken, getToken, getTransactionMeta, getUserInfo, getWellKnown, getWithPopup, getWithRedirect, getWithoutPrompt, handleEmailVerifyCallback, handleInteractionCodeRedirect, handleOAuthResponse, hasAuthorizationCode, hasErrorInUrl, hasInteractionCode, hasSavedInteractionHandle, hasTokensInHash, interact, introspect, introspectAuthn, isAbsoluteUrl, isAccessToken, isAuthApiError, isAuthorizationCodeError, isCodeFlow, isCustomAuthTransactionMeta, isEmailVerifyCallback, isEmailVerifyCallbackError, isFunction, isIDToken, isIdxTransactionMeta, isInteractionRequired, isInteractionRequiredError, isLoginRedirect, isNumber, isOAuthTransactionMeta, isObject, isPKCETransactionMeta, isPromise, isRedirectUri, isRefreshToken, isRefreshTokenError, isSameRefreshToken, isString, isToken, isTransactionMeta, isTransactionMetaValid, isTransactionMetaValidForFlow, isTransactionMetaValidForOptions, isoToUTCString, loadFrame, loadPopup, omit, parseEmailVerifyCallback, parseFromUrl, PKCE as pkce, poll, postRefreshToken, postToTokenEndpoint, postToTransaction, preparePKCE, prepareTokenParams, proceed, recoverPassword, register, removeListener, removeNils, removeTrailingSlash, renewToken, renewTokens, renewTokensWithRefresh, resumeTransaction, revokeToken, saveTransactionMeta, startTransaction, toAbsoluteUrl, toQueryString, toRelativeUrl, transactionExists, transactionStatus, transactionStep, unlockAccount, urlParamsToObject, validateClaims, validateCodeChallengeMethod, validateToken, verifyToken, warn };
9460
+ export { ACCESS_TOKEN_STORAGE_KEY, AuthApiError, AuthPollStopError, AuthSdkError, AuthStateManager, AuthTransaction, AuthenticatorKey, CACHE_STORAGE_NAME, DEFAULT_CACHE_DURATION, DEFAULT_CODE_CHALLENGE_METHOD, DEFAULT_MAX_CLOCK_SKEW, DEFAULT_POLLING_DELAY, EVENT_ADDED, EVENT_ERROR, EVENT_EXPIRED, EVENT_REMOVED, EVENT_RENEWED, IDX_API_VERSION, IDX_RESPONSE_STORAGE_NAME, ID_TOKEN_STORAGE_KEY, INITIAL_AUTH_STATE, IdxFeature, IdxStatus, MAX_VERIFIER_LENGTH, MIN_VERIFIER_LENGTH, OAuthError, ORIGINAL_URI_STORAGE_NAME, OktaAuth, PKCE_STORAGE_NAME, REDIRECT_NONCE_COOKIE_NAME, REDIRECT_OAUTH_PARAMS_NAME, REDIRECT_STATE_COOKIE_NAME, REFERRER_PATH_STORAGE_KEY, REFRESH_TOKEN_STORAGE_KEY, SHARED_TRANSACTION_STORAGE_NAME, STATE_TOKEN_KEY_NAME, StorageManager, TOKEN_STORAGE_NAME, TRANSACTION_STORAGE_NAME, TokenManager, addListener, addPostMessageListener, addStateToken, assertPKCESupport, authenticate, bind, buildAuthorizeParams, canProceed, cancel, clearTransactionMeta, clone, convertTokenParamsToOAuthParams, createOAuthMeta, createTransactionMeta, crypto$1 as crypto, decodeToken, delay, deprecate, deprecateWrap, exchangeCodeForTokens, extend, find, genRandomString, generateNonce, generateState, getConsole, getDefaultTokenParams, getHashOrSearch, getKey, getLink, getNativeConsole, getOAuthBaseUrl, getOAuthDomain, getOAuthUrls, getPollFn, getSavedTransactionMeta, getStateToken, getToken, getTransactionMeta, getUserInfo, getWellKnown, getWithPopup, getWithRedirect, getWithoutPrompt, handleEmailVerifyCallback, handleInteractionCodeRedirect, handleOAuthResponse, hasAuthorizationCode, hasErrorInUrl, hasInteractionCode, hasSavedInteractionHandle, hasTokensInHash, interact, introspect, introspectAuthn, isAbsoluteUrl, isAccessToken, isAuthApiError, isAuthenticator, isAuthorizationCodeError, isCodeFlow, isCustomAuthTransactionMeta, isEmailVerifyCallback, isEmailVerifyCallbackError, isFunction, isIDToken, isIdxTransactionMeta, isInteractionRequired, isInteractionRequiredError, isLoginRedirect, isNumber, isOAuthTransactionMeta, isObject, isPKCETransactionMeta, isPromise, isRedirectUri, isRefreshToken, isRefreshTokenError, isSameRefreshToken, isString, isToken, isTransactionMeta, isTransactionMetaValid, isTransactionMetaValidForFlow, isTransactionMetaValidForOptions, isoToUTCString, loadFrame, loadPopup, omit, parseEmailVerifyCallback, parseFromUrl, PKCE as pkce, poll, postRefreshToken, postToTokenEndpoint, postToTransaction, preparePKCE, prepareTokenParams, proceed, recoverPassword, register, removeListener, removeNils, removeTrailingSlash, renewToken, renewTokens, renewTokensWithRefresh, resumeTransaction, revokeToken, saveTransactionMeta, startTransaction, toAbsoluteUrl, toQueryString, toRelativeUrl, transactionExists, transactionStatus, transactionStep, unlockAccount, urlParamsToObject, validateClaims, validateCodeChallengeMethod, validateToken, verifyToken, warn };
9176
9461
  //# sourceMappingURL=esm.browser.js.map