@okta/okta-auth-js 6.2.0 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +23 -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 +8 -2
  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 +65 -72
  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/cjs/options.js +170 -0
  89. package/cjs/options.js.map +1 -0
  90. package/dist/okta-auth-js.min.js +1 -1
  91. package/dist/okta-auth-js.min.js.map +1 -1
  92. package/dist/okta-auth-js.umd.js +1 -1
  93. package/dist/okta-auth-js.umd.js.map +1 -1
  94. package/esm/esm.browser.js +1178 -794
  95. package/esm/esm.browser.js.map +1 -1
  96. package/esm/esm.node.mjs +1099 -781
  97. package/esm/esm.node.mjs.map +1 -1
  98. package/lib/AuthStateManager.d.ts +2 -0
  99. package/lib/PromiseQueue.d.ts +6 -2
  100. package/lib/TransactionManager.d.ts +3 -4
  101. package/lib/idx/authenticator/Authenticator.d.ts +1 -1
  102. package/lib/idx/authenticator/OktaPassword.d.ts +2 -1
  103. package/lib/idx/authenticator/OktaVerifyTotp.d.ts +1 -1
  104. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +3 -5
  105. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +1 -1
  106. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +2 -1
  107. package/lib/idx/authenticator/WebauthnEnrollment.d.ts +1 -1
  108. package/lib/idx/authenticator/WebauthnVerification.d.ts +1 -1
  109. package/lib/idx/authenticator/util.d.ts +4 -0
  110. package/lib/idx/idx-js/index.d.ts +1 -17
  111. package/lib/idx/idx-js/introspect.d.ts +2 -1
  112. package/lib/idx/idx-js/v1/generateIdxAction.d.ts +1 -1
  113. package/lib/idx/idx-js/v1/makeIdxState.d.ts +2 -2
  114. package/lib/idx/proceed.d.ts +1 -3
  115. package/lib/idx/remediate.d.ts +2 -2
  116. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +1 -0
  117. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +0 -3
  118. package/lib/idx/remediators/Base/Remediator.d.ts +5 -4
  119. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +7 -9
  120. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -4
  121. package/lib/idx/remediators/ChallengePoll.d.ts +1 -0
  122. package/lib/idx/remediators/EnrollProfile.d.ts +0 -3
  123. package/lib/idx/remediators/EnrollmentChannelData.d.ts +0 -4
  124. package/lib/idx/remediators/Identify.d.ts +3 -5
  125. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -5
  126. package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +2 -1
  127. package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +1 -2
  128. package/lib/idx/remediators/Skip.d.ts +0 -3
  129. package/lib/idx/types/idx-js.d.ts +5 -1
  130. package/lib/idx/types/index.d.ts +7 -3
  131. package/lib/idx/util.d.ts +11 -0
  132. package/lib/options/browser.d.ts +2 -2
  133. package/lib/options/node.d.ts +2 -2
  134. package/lib/options.d.ts +14 -0
  135. package/lib/types/Storage.d.ts +7 -5
  136. package/lib/types/api.d.ts +1 -3
  137. package/package.json +7 -6
@@ -6,7 +6,11 @@ exports.VerifyAuthenticator = void 0;
6
6
 
7
7
  var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
8
 
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
9
+ var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter"));
10
+
11
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
12
+
13
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
10
14
 
11
15
  var _Remediator = require("./Remediator");
12
16
 
@@ -27,9 +31,6 @@ var _authenticator = require("../../authenticator");
27
31
  class VerifyAuthenticator extends _Remediator.Remediator {
28
32
  constructor(remediation, values = {}) {
29
33
  super(remediation, values);
30
- (0, _defineProperty2.default)(this, "map", {
31
- 'credentials': []
32
- });
33
34
  this.authenticator = (0, _authenticator.getAuthenticator)(remediation);
34
35
  }
35
36
 
@@ -55,6 +56,16 @@ class VerifyAuthenticator extends _Remediator.Remediator {
55
56
  return this.authenticator.getInputs(input);
56
57
  }
57
58
 
59
+ getValuesAfterProceed() {
60
+ var _context;
61
+
62
+ this.values = super.getValuesAfterProceed();
63
+ let trimmedValues = (0, _filter.default)(_context = (0, _keys.default)((0, _values.default)(this))).call(_context, valueKey => valueKey !== 'credentials');
64
+ return (0, _reduce.default)(trimmedValues).call(trimmedValues, (values, valueKey) => ({ ...values,
65
+ [valueKey]: (0, _values.default)(this)[valueKey]
66
+ }), {});
67
+ }
68
+
58
69
  }
59
70
 
60
71
  exports.VerifyAuthenticator = VerifyAuthenticator;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getNextStep","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs"],"mappings":";;;;;;;;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACO,MAAMA,mBAAN,SAAkCC,sBAAlC,CAA6C;AASlDC,EAAAA,WAAW,CAACC,WAAD,EAA8BC,MAAiC,GAAG,EAAlE,EAAsE;AAC/E,UAAMD,WAAN,EAAmBC,MAAnB;AAD+E,+CAJ3E;AACJ,qBAAe;AADX,KAI2E;AAE/E,SAAKC,aAAL,GAAqB,qCAAiBF,WAAjB,CAArB;AACD;;AAEDG,EAAAA,WAAW,CAACC,OAAD,EAAiC;AAAA;;AAC1C,UAAMC,QAAQ,GAAG,MAAMF,WAAN,CAAkBC,OAAlB,CAAjB;AACA,UAAME,wBAAwB,GAAGF,OAAH,aAAGA,OAAH,gDAAGA,OAAO,CAAEE,wBAAZ,0DAAG,sBAAmCC,KAApE;AAEA,WAAO,EACL,GAAGF,QADE;AAELC,MAAAA;AAFK,KAAP;AAID;;AAEDE,EAAAA,YAAY,GAAG;AACb,WAAO,KAAKN,aAAL,CAAmBO,SAAnB,sBAA6B,IAA7B,EAAP;AACD;;AAEDC,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKR,aAAL,CAAmBQ,cAAnB,sBAAkC,IAAlC,EAAP;AACD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,KAAKV,aAAL,CAAmBW,SAAnB,CAA6BD,KAA7B,CAAP;AACD;;AAlCiD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator extends Remediator {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n values!: VerifyAuthenticatorValues;\n\n map = {\n 'credentials': []\n };\n\n constructor(remediation: IdxRemediation, values: VerifyAuthenticatorValues = {}) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n}\n"],"file":"VerifyAuthenticator.js"}
1
+ {"version":3,"sources":["../../../../../lib/idx/remediators/Base/VerifyAuthenticator.ts"],"names":["VerifyAuthenticator","Remediator","constructor","remediation","values","authenticator","getNextStep","context","nextStep","authenticatorEnrollments","value","canRemediate","canVerify","mapCredentials","getInputCredentials","input","getInputs","getValuesAfterProceed","trimmedValues","valueKey"],"mappings":";;;;;;;;;;;;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA;AACO,MAAMA,mBAAN,SAAkCC,sBAAlC,CAA6C;AAKlDC,EAAAA,WAAW,CAACC,WAAD,EAA8BC,MAAiC,GAAG,EAAlE,EAAsE;AAC/E,UAAMD,WAAN,EAAmBC,MAAnB;AACA,SAAKC,aAAL,GAAqB,qCAAiBF,WAAjB,CAArB;AACD;;AAEDG,EAAAA,WAAW,CAACC,OAAD,EAAiC;AAAA;;AAC1C,UAAMC,QAAQ,GAAG,MAAMF,WAAN,CAAkBC,OAAlB,CAAjB;AACA,UAAME,wBAAwB,GAAGF,OAAH,aAAGA,OAAH,gDAAGA,OAAO,CAAEE,wBAAZ,0DAAG,sBAAmCC,KAApE;AAEA,WAAO,EACL,GAAGF,QADE;AAELC,MAAAA;AAFK,KAAP;AAID;;AAEDE,EAAAA,YAAY,GAAG;AACb,WAAO,KAAKN,aAAL,CAAmBO,SAAnB,sBAA6B,IAA7B,EAAP;AACD;;AAEDC,EAAAA,cAAc,GAAG;AACf,WAAO,KAAKR,aAAL,CAAmBQ,cAAnB,sBAAkC,IAAlC,EAAP;AACD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,KAAKV,aAAL,CAAmBW,SAAnB,CAA6BD,KAA7B,CAAP;AACD;;AAEDE,EAAAA,qBAAqB,GAA8B;AAAA;;AACjD,SAAKb,MAAL,GAAc,MAAMa,qBAAN,EAAd;AACA,QAAIC,aAAa,GAAG,wEAAY,IAAZ,mBAAgCC,QAAQ,IAAIA,QAAQ,KAAK,aAAzD,CAApB;AACA,WAAO,qBAAAD,aAAa,MAAb,CAAAA,aAAa,EAAQ,CAACd,MAAD,EAASe,QAAT,MAAuB,EAAC,GAAGf,MAAJ;AAAY,OAACe,QAAD,GAAY,2BAAYA,QAAZ;AAAxB,KAAvB,CAAR,EAAgF,EAAhF,CAApB;AACD;;AApCiD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Remediator';\nimport { getAuthenticator, Authenticator, AuthenticatorValues } from '../../authenticator';\nimport { IdxRemediation, IdxContext } from '../../types/idx-js';\nimport { NextStep } from '../../types';\n\nexport type VerifyAuthenticatorValues = AuthenticatorValues & RemediationValues;\n\n// Base class - DO NOT expose static remediationName\nexport class VerifyAuthenticator extends Remediator {\n\n authenticator: Authenticator<VerifyAuthenticatorValues>;\n values!: VerifyAuthenticatorValues;\n\n constructor(remediation: IdxRemediation, values: VerifyAuthenticatorValues = {}) {\n super(remediation, values);\n this.authenticator = getAuthenticator(remediation);\n }\n\n getNextStep(context?: IdxContext): NextStep {\n const nextStep = super.getNextStep(context);\n const authenticatorEnrollments = context?.authenticatorEnrollments?.value;\n\n return {\n ...nextStep,\n authenticatorEnrollments\n };\n }\n\n canRemediate() {\n return this.authenticator.canVerify(this.values);\n }\n\n mapCredentials() {\n return this.authenticator.mapCredentials(this.values);\n }\n\n getInputCredentials(input) {\n return this.authenticator.getInputs(input);\n }\n\n getValuesAfterProceed(): VerifyAuthenticatorValues {\n this.values = super.getValuesAfterProceed();\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'credentials');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"VerifyAuthenticator.js"}
@@ -4,6 +4,8 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
 
5
5
  exports.ChallengePoll = void 0;
6
6
 
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
7
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
10
 
9
11
  var _EnrollPoll = require("./EnrollPoll");
@@ -19,7 +21,12 @@ var _EnrollPoll = require("./EnrollPoll");
19
21
  *
20
22
  * See the License for the specific language governing permissions and limitations under the License.
21
23
  */
22
- class ChallengePoll extends _EnrollPoll.EnrollPoll {}
24
+ class ChallengePoll extends _EnrollPoll.EnrollPoll {
25
+ canRemediate() {
26
+ return !!(0, _values.default)(this).startPolling || this.options.step === 'challenge-poll';
27
+ }
28
+
29
+ }
23
30
 
24
31
  exports.ChallengePoll = ChallengePoll;
25
32
  (0, _defineProperty2.default)(ChallengePoll, "remediationName", 'challenge-poll');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ChallengePoll.ts"],"names":["ChallengePoll","EnrollPoll"],"mappings":";;;;;;;;AAYA;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIO,MAAMA,aAAN,SAA4BC,sBAA5B,CAAsC;;;8BAAhCD,a,qBACc,gB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { EnrollPoll } from './EnrollPoll';\n\nexport class ChallengePoll extends EnrollPoll{\n static remediationName = 'challenge-poll';\n}\n"],"file":"ChallengePoll.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/ChallengePoll.ts"],"names":["ChallengePoll","EnrollPoll","canRemediate","startPolling","options","step"],"mappings":";;;;;;;;;;AAYA;;AAZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIO,MAAMA,aAAN,SAA4BC,sBAA5B,CAAsC;AAG3CC,EAAAA,YAAY,GAAG;AACb,WAAO,CAAC,CAAC,2BAAYC,YAAd,IAA8B,KAAKC,OAAL,CAAaC,IAAb,KAAsB,gBAA3D;AACD;;AAL0C;;;8BAAhCL,a,qBACc,gB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { EnrollPoll } from './EnrollPoll';\n\nexport class ChallengePoll extends EnrollPoll{\n static remediationName = 'challenge-poll';\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'challenge-poll';\n }\n}\n"],"file":"ChallengePoll.js"}
@@ -29,7 +29,7 @@ var _Remediator = require("./Base/Remediator");
29
29
  */
30
30
  class EnrollPoll extends _Remediator.Remediator {
31
31
  canRemediate() {
32
- return Boolean((0, _values.default)(this).startPolling);
32
+ return !!(0, _values.default)(this).startPolling || this.options.step === 'enroll-poll';
33
33
  }
34
34
 
35
35
  getNextStep(context) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"names":["EnrollPoll","Remediator","canRemediate","Boolean","startPolling","getNextStep","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","valueKey","values"],"mappings":";;;;;;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWO,MAAMA,UAAN,SAAyBC,sBAAzB,CAAoC;AAKzCC,EAAAA,YAAY,GAAG;AACb,WAAOC,OAAO,CAAC,2BAAYC,YAAb,CAAd;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAiC;AAC1C,UAAMC,MAAM,GAAG,MAAMF,WAAN,CAAkBC,OAAlB,CAAf;AACA,QAAIE,aAAa,GAAG,KAAKC,gBAAL,EAApB;;AACA,QAAI,CAACD,aAAD,IAAkBF,OAAlB,aAAkBA,OAAlB,eAAkBA,OAAO,CAAEI,oBAA/B,EAAqD;AACnDF,MAAAA,aAAa,GAAGF,OAAO,CAACI,oBAAR,CAA6BC,KAA7C;AACD;;AACD,WAAO,EACL,GAAGJ,MADE;AAELC,MAAAA,aAFK;AAGLI,MAAAA,IAAI,EAAE;AACJC,QAAAA,QAAQ,EAAE,IADN;AAEJC,QAAAA,OAAO,EAAE,KAAKC,WAAL,CAAiBD;AAFtB;AAHD,KAAP;AAQD;;AAEDE,EAAAA,qBAAqB,GAAqB;AAAA;;AACxC,QAAIC,aAAa,GAAG,wEAAY,IAAZ,mBAAgCC,QAAQ,IAAIA,QAAQ,KAAK,cAAzD,CAApB;AACA,WAAO,qBAAAD,aAAa,MAAb,CAAAA,aAAa,EAAQ,CAACE,MAAD,EAASD,QAAT,MAAuB,EAAC,GAAGC,MAAJ;AAAY,OAACD,QAAD,GAAY,2BAAYA,QAAZ;AAAxB,KAAvB,CAAR,EAAgF,EAAhF,CAApB;AACD;;AA5BwC;;;8BAA9BlB,U,qBACc,a","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep } from '../../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator {\n static remediationName = 'enroll-poll';\n\n values!: EnrollPollValues;\n\n canRemediate() {\n return Boolean(this.values.startPolling);\n }\n\n getNextStep(context?: IdxContext): NextStep {\n const common = super.getNextStep(context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"EnrollPoll.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"names":["EnrollPoll","Remediator","canRemediate","startPolling","options","step","getNextStep","context","common","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","valueKey","values"],"mappings":";;;;;;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWO,MAAMA,UAAN,SAAyBC,sBAAzB,CAAoC;AAKzCC,EAAAA,YAAY,GAAG;AACb,WAAO,CAAC,CAAC,2BAAYC,YAAd,IAA8B,KAAKC,OAAL,CAAaC,IAAb,KAAsB,aAA3D;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAiC;AAC1C,UAAMC,MAAM,GAAG,MAAMF,WAAN,CAAkBC,OAAlB,CAAf;AACA,QAAIE,aAAa,GAAG,KAAKC,gBAAL,EAApB;;AACA,QAAI,CAACD,aAAD,IAAkBF,OAAlB,aAAkBA,OAAlB,eAAkBA,OAAO,CAAEI,oBAA/B,EAAqD;AACnDF,MAAAA,aAAa,GAAGF,OAAO,CAACI,oBAAR,CAA6BC,KAA7C;AACD;;AACD,WAAO,EACL,GAAGJ,MADE;AAELC,MAAAA,aAFK;AAGLI,MAAAA,IAAI,EAAE;AACJC,QAAAA,QAAQ,EAAE,IADN;AAEJC,QAAAA,OAAO,EAAE,KAAKC,WAAL,CAAiBD;AAFtB;AAHD,KAAP;AAQD;;AAEDE,EAAAA,qBAAqB,GAAqB;AAAA;;AACxC,QAAIC,aAAa,GAAG,wEAAY,IAAZ,mBAAgCC,QAAQ,IAAIA,QAAQ,KAAK,cAAzD,CAApB;AACA,WAAO,qBAAAD,aAAa,MAAb,CAAAA,aAAa,EAAQ,CAACE,MAAD,EAASD,QAAT,MAAuB,EAAC,GAAGC,MAAJ;AAAY,OAACD,QAAD,GAAY,2BAAYA,QAAZ;AAAxB,KAAvB,CAAR,EAAgF,EAAhF,CAApB;AACD;;AA5BwC;;;8BAA9BnB,U,qBACc,a","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { NextStep } from '../../types';\nimport { IdxContext } from '../types/idx-js';\n\nexport interface EnrollPollValues extends RemediationValues {\n startPolling?: boolean;\n}\n\nexport class EnrollPoll extends Remediator {\n static remediationName = 'enroll-poll';\n\n values!: EnrollPollValues;\n\n canRemediate() {\n return !!this.values.startPolling || this.options.step === 'enroll-poll';\n }\n\n getNextStep(context?: IdxContext): NextStep {\n const common = super.getNextStep(context);\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n ...common,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): EnrollPollValues {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"EnrollPoll.js"}
@@ -12,6 +12,8 @@ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable
12
12
 
13
13
  var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
14
14
 
15
+ var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));
16
+
15
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
16
18
 
17
19
  var _Remediator = require("./Base/Remediator");
@@ -30,17 +32,15 @@ var _Remediator = require("./Base/Remediator");
30
32
  * See the License for the specific language governing permissions and limitations under the License.
31
33
  */
32
34
  class EnrollProfile extends _Remediator.Remediator {
33
- constructor(...args) {
34
- super(...args);
35
- (0, _defineProperty2.default)(this, "map", {
36
- 'userProfile': []
37
- });
38
- }
39
-
40
35
  canRemediate() {
41
36
  var _context, _context2;
42
37
 
43
- const userProfileFromValues = this.getData().userProfile; // eslint-disable-next-line max-len
38
+ const userProfileFromValues = this.getData().userProfile;
39
+
40
+ if (!userProfileFromValues) {
41
+ return false;
42
+ } // eslint-disable-next-line max-len
43
+
44
44
 
45
45
  const userProfileFromRemediation = (0, _find.default)(_context = this.remediation.value).call(_context, ({
46
46
  name
@@ -62,9 +62,15 @@ class EnrollProfile extends _Remediator.Remediator {
62
62
  const attributeNames = (0, _map.default)(profileAttributes).call(profileAttributes, ({
63
63
  name
64
64
  }) => name);
65
- return (0, _reduce.default)(attributeNames).call(attributeNames, (attributeValues, attributeName) => (0, _values.default)(this)[attributeName] ? { ...attributeValues,
65
+ const data = (0, _reduce.default)(attributeNames).call(attributeNames, (attributeValues, attributeName) => (0, _values.default)(this)[attributeName] ? { ...attributeValues,
66
66
  [attributeName]: (0, _values.default)(this)[attributeName]
67
67
  } : attributeValues, {});
68
+
69
+ if ((0, _keys.default)(data).length === 0) {
70
+ return;
71
+ }
72
+
73
+ return data;
68
74
  }
69
75
 
70
76
  getInputUserProfile(input) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/EnrollProfile.ts"],"names":["EnrollProfile","Remediator","canRemediate","userProfileFromValues","getData","userProfile","userProfileFromRemediation","remediation","value","name","form","curr","required","mapUserProfile","profileAttributes","attributeNames","attributeValues","attributeName","getInputUserProfile","input","getErrorMessages","errorRemediation","errors","field","messages","push","message"],"mappings":";;;;;;;;;;;;;;;;AAeA;;AAfA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,aAAN,SAA4BC,sBAA5B,CAAuC;AAAA;AAAA;AAAA,+CAKtC;AACJ,qBAAe;AADX,KALsC;AAAA;;AAS5CC,EAAAA,YAAY,GAAG;AAAA;;AACb,UAAMC,qBAAqB,GAAG,KAAKC,OAAL,GAAeC,WAA7C,CADa,CAEb;;AACA,UAAMC,0BAA0B,GAAG,mCAAKC,WAAL,CAAiBC,KAAjB,iBAA6B,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,aAApD,CAAnC;AACA,WAAO,iCAAAH,0BAA0B,CAACI,IAA3B,CAAiCF,KAAjC,kBAA8C,CAACN,YAAD,EAAeS,IAAf,KAAwB;AAC3E,UAAIA,IAAI,CAACC,QAAT,EAAmB;AACjBV,QAAAA,YAAY,GAAGA,YAAY,IAAI,CAAC,CAACC,qBAAqB,CAACQ,IAAI,CAACF,IAAN,CAAtD;AACD;;AACD,aAAOP,YAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD;;AAEDW,EAAAA,cAAc,CAAC;AAACH,IAAAA,IAAI,EAAE;AAAEF,MAAAA,KAAK,EAAEM;AAAT;AAAP,GAAD,EAAuC;AACnD,UAAMC,cAAc,GAAG,kBAAAD,iBAAiB,MAAjB,CAAAA,iBAAiB,EAAK,CAAC;AAACL,MAAAA;AAAD,KAAD,KAAYA,IAAjB,CAAxC;AACA,WAAO,qBAAAM,cAAc,MAAd,CAAAA,cAAc,EAAQ,CAACC,eAAD,EAAkBC,aAAlB,KAC3B,2BAAYA,aAAZ,IAA6B,EAC7B,GAAGD,eAD0B;AAE7B,OAACC,aAAD,GAAiB,2BAAYA,aAAZ;AAFY,KAA7B,GAGED,eAJiB,EAIC,EAJD,CAArB;AAKD;;AAEDE,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,CAAC,GAAGA,KAAK,CAACT,IAAN,CAAWF,KAAf,CAAP;AACD;;AAEDY,EAAAA,gBAAgB,CAACC,gBAAD,EAAmB;AAAA;;AACjC,WAAO,iCAAAA,gBAAgB,CAACb,KAAjB,CAAuB,CAAvB,EAA0BE,IAA1B,CAA+BF,KAA/B,kBAA4C,CAACc,MAAD,EAASC,KAAT,KAAmB;AACpE,UAAIA,KAAK,CAACC,QAAV,EAAoB;AAClBF,QAAAA,MAAM,CAACG,IAAP,CAAYF,KAAK,CAACC,QAAN,CAAehB,KAAf,CAAqB,CAArB,EAAwBkB,OAApC;AACD;;AACD,aAAOJ,MAAP;AACD,KALM,EAKJ,EALI,CAAP;AAMD;;AAzC2C;;;8BAAjCtB,a,qBACc,gB","sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { IdxRemediationValue } from '../types/idx-js';\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface EnrollProfileValues extends RemediationValues {\n firstName?: string;\n lastName?: string;\n email?: string;\n}\n\nexport class EnrollProfile extends Remediator {\n static remediationName = 'enroll-profile';\n\n values!: EnrollProfileValues;\n\n map = {\n 'userProfile': []\n };\n\n canRemediate() {\n const userProfileFromValues = this.getData().userProfile;\n // eslint-disable-next-line max-len\n const userProfileFromRemediation = this.remediation.value!.find(({ name }) => name === 'userProfile') as IdxRemediationValue;\n return userProfileFromRemediation.form!.value.reduce((canRemediate, curr) => {\n if (curr.required) {\n canRemediate = canRemediate && !!userProfileFromValues[curr.name];\n }\n return canRemediate;\n }, true);\n }\n\n mapUserProfile({form: { value: profileAttributes }}) {\n const attributeNames = profileAttributes.map(({name}) => name);\n return attributeNames.reduce((attributeValues, attributeName) => (\n this.values[attributeName] ? {\n ...attributeValues,\n [attributeName]: this.values[attributeName]\n } : attributeValues), {});\n }\n\n getInputUserProfile(input) {\n return [...input.form.value];\n }\n\n getErrorMessages(errorRemediation) {\n return errorRemediation.value[0].form.value.reduce((errors, field) => {\n if (field.messages) {\n errors.push(field.messages.value[0].message);\n }\n return errors;\n }, []);\n }\n}"],"file":"EnrollProfile.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/EnrollProfile.ts"],"names":["EnrollProfile","Remediator","canRemediate","userProfileFromValues","getData","userProfile","userProfileFromRemediation","remediation","value","name","form","curr","required","mapUserProfile","profileAttributes","attributeNames","data","attributeValues","attributeName","length","getInputUserProfile","input","getErrorMessages","errorRemediation","errors","field","messages","push","message"],"mappings":";;;;;;;;;;;;;;;;;;AAeA;;AAfA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,aAAN,SAA4BC,sBAA5B,CAAuC;AAK5CC,EAAAA,YAAY,GAAG;AAAA;;AACb,UAAMC,qBAAqB,GAAG,KAAKC,OAAL,GAAeC,WAA7C;;AACA,QAAI,CAACF,qBAAL,EAA4B;AAC1B,aAAO,KAAP;AACD,KAJY,CAKb;;;AACA,UAAMG,0BAA0B,GAAG,mCAAKC,WAAL,CAAiBC,KAAjB,iBAA6B,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,aAApD,CAAnC;AACA,WAAO,iCAAAH,0BAA0B,CAACI,IAA3B,CAAiCF,KAAjC,kBAA8C,CAACN,YAAD,EAAeS,IAAf,KAAwB;AAC3E,UAAIA,IAAI,CAACC,QAAT,EAAmB;AACjBV,QAAAA,YAAY,GAAGA,YAAY,IAAI,CAAC,CAACC,qBAAqB,CAACQ,IAAI,CAACF,IAAN,CAAtD;AACD;;AACD,aAAOP,YAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD;;AAEDW,EAAAA,cAAc,CAAC;AAACH,IAAAA,IAAI,EAAE;AAAEF,MAAAA,KAAK,EAAEM;AAAT;AAAP,GAAD,EAAuC;AACnD,UAAMC,cAAc,GAAG,kBAAAD,iBAAiB,MAAjB,CAAAA,iBAAiB,EAAK,CAAC;AAACL,MAAAA;AAAD,KAAD,KAAYA,IAAjB,CAAxC;AACA,UAAMO,IAAI,GAAG,qBAAAD,cAAc,MAAd,CAAAA,cAAc,EAAQ,CAACE,eAAD,EAAkBC,aAAlB,KACjC,2BAAYA,aAAZ,IAA6B,EAC7B,GAAGD,eAD0B;AAE7B,OAACC,aAAD,GAAiB,2BAAYA,aAAZ;AAFY,KAA7B,GAGED,eAJuB,EAIL,EAJK,CAA3B;;AAKA,QAAI,mBAAYD,IAAZ,EAAkBG,MAAlB,KAA6B,CAAjC,EAAoC;AAClC;AACD;;AACD,WAAOH,IAAP;AACD;;AAEDI,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,CAAC,GAAGA,KAAK,CAACX,IAAN,CAAWF,KAAf,CAAP;AACD;;AAEDc,EAAAA,gBAAgB,CAACC,gBAAD,EAAmB;AAAA;;AACjC,WAAO,iCAAAA,gBAAgB,CAACf,KAAjB,CAAuB,CAAvB,EAA0BE,IAA1B,CAA+BF,KAA/B,kBAA4C,CAACgB,MAAD,EAASC,KAAT,KAAmB;AACpE,UAAIA,KAAK,CAACC,QAAV,EAAoB;AAClBF,QAAAA,MAAM,CAACG,IAAP,CAAYF,KAAK,CAACC,QAAN,CAAelB,KAAf,CAAqB,CAArB,EAAwBoB,OAApC;AACD;;AACD,aAAOJ,MAAP;AACD,KALM,EAKJ,EALI,CAAP;AAMD;;AA5C2C;;;8BAAjCxB,a,qBACc,gB","sourcesContent":["/* eslint-disable @typescript-eslint/no-non-null-assertion */\n/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { IdxRemediationValue } from '../types/idx-js';\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface EnrollProfileValues extends RemediationValues {\n firstName?: string;\n lastName?: string;\n email?: string;\n}\n\nexport class EnrollProfile extends Remediator {\n static remediationName = 'enroll-profile';\n\n values!: EnrollProfileValues;\n\n canRemediate() {\n const userProfileFromValues = this.getData().userProfile;\n if (!userProfileFromValues) {\n return false;\n }\n // eslint-disable-next-line max-len\n const userProfileFromRemediation = this.remediation.value!.find(({ name }) => name === 'userProfile') as IdxRemediationValue;\n return userProfileFromRemediation.form!.value.reduce((canRemediate, curr) => {\n if (curr.required) {\n canRemediate = canRemediate && !!userProfileFromValues[curr.name];\n }\n return canRemediate;\n }, true);\n }\n\n mapUserProfile({form: { value: profileAttributes }}) {\n const attributeNames = profileAttributes.map(({name}) => name);\n const data = attributeNames.reduce((attributeValues, attributeName) => (\n this.values[attributeName] ? {\n ...attributeValues,\n [attributeName]: this.values[attributeName]\n } : attributeValues), {});\n if (Object.keys(data).length === 0) {\n return;\n }\n return data;\n }\n\n getInputUserProfile(input) {\n return [...input.form.value];\n }\n\n getErrorMessages(errorRemediation) {\n return errorRemediation.value[0].form.value.reduce((errors, field) => {\n if (field.messages) {\n errors.push(field.messages.value[0].message);\n }\n return errors;\n }, []);\n }\n}"],"file":"EnrollProfile.js"}
@@ -30,14 +30,6 @@ var _Remediator = require("./Base/Remediator");
30
30
  * See the License for the specific language governing permissions and limitations under the License.
31
31
  */
32
32
  class EnrollmentChannelData extends _Remediator.Remediator {
33
- constructor(...args) {
34
- super(...args);
35
- (0, _defineProperty2.default)(this, "map", {
36
- email: [],
37
- phoneNumber: []
38
- });
39
- }
40
-
41
33
  getInputEmail() {
42
34
  return [{
43
35
  name: 'email',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/EnrollmentChannelData.ts"],"names":["EnrollmentChannelData","Remediator","email","phoneNumber","getInputEmail","name","type","required","label","getInputPhoneNumber","canRemediate","Boolean","getNextStep","context","common","authenticator","currentAuthenticator","value","getData","stateHandle","getValuesAfterProceed","trimmedValues","valueKey","values"],"mappings":";;;;;;;;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,qBAAN,SAAoCC,sBAApC,CAA+C;AAAA;AAAA;AAAA,+CAK9C;AACJC,MAAAA,KAAK,EAAE,EADH;AAEJC,MAAAA,WAAW,EAAE;AAFT,KAL8C;AAAA;;AAUpDC,EAAAA,aAAa,GAAG;AACd,WAAO,CACL;AAAEC,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,IAAI,EAAE,QAAvB;AAAiCC,MAAAA,QAAQ,EAAE,IAA3C;AAAiDC,MAAAA,KAAK,EAAE;AAAxD,KADK,CAAP;AAGD;;AAEDC,EAAAA,mBAAmB,GAAG;AACpB,WAAO,CACL;AAAEJ,MAAAA,IAAI,EAAE,aAAR;AAAuBC,MAAAA,IAAI,EAAE,QAA7B;AAAuCC,MAAAA,QAAQ,EAAE,IAAjD;AAAuDC,MAAAA,KAAK,EAAE;AAA9D,KADK,CAAP;AAGD;;AAEDE,EAAAA,YAAY,GAAG;AACb,WAAOC,OAAO,CAAC,2BAAYT,KAAZ,IAAqB,2BAAYC,WAAlC,CAAd;AACD;;AAEDS,EAAAA,WAAW,CAACC,OAAD,EAAsB;AAC/B,UAAMC,MAAM,GAAG,MAAMF,WAAN,EAAf;AACA,UAAMG,aAAa,GAAGF,OAAO,CAACG,oBAAR,CAA6BC,KAAnD;AACA,WAAO,EACL,GAAGH,MADE;AAELC,MAAAA;AAFK,KAAP;AAID;;AAEDG,EAAAA,OAAO,GAAG;AACR,WAAO;AACLC,MAAAA,WAAW,EAAE,2BAAYA,WADpB;AAELjB,MAAAA,KAAK,EAAE,2BAAYA,KAFd;AAGLC,MAAAA,WAAW,EAAE,2BAAYA;AAHpB,KAAP;AAKD;;AAEDiB,EAAAA,qBAAqB,GAAG;AAAA;;AACtB,QAAIC,aAAa,GAAG,wEAAY,IAAZ,mBAAgCC,QAAQ;AAAA;;AAAA,aAAI,CAAC,oCAAC,OAAD,EAAU,aAAV,mBAAkCA,QAAlC,CAAL;AAAA,KAAxC,CAApB;AACA,WAAO,qBAAAD,aAAa,MAAb,CAAAA,aAAa,EAAQ,CAACE,MAAD,EAASD,QAAT,MAAuB,EAAC,GAAGC,MAAJ;AAAY,OAACD,QAAD,GAAY,2BAAYA,QAAZ;AAAxB,KAAvB,CAAR,EAAgF,EAAhF,CAApB;AACD;;AA9CmD;;;8BAAzCtB,qB,qBACc,yB","sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxContext } from '../types/idx-js';\n\n\nexport type EnrollmentChannelDataValues = RemediationValues & {\n email?: string;\n phoneNumber?: string;\n};\n\nexport class EnrollmentChannelData extends Remediator {\n static remediationName = 'enrollment-channel-data';\n\n values!: EnrollmentChannelDataValues;\n\n map = {\n email: [],\n phoneNumber: []\n }\n\n getInputEmail() {\n return [\n { name: 'email', type: 'string', required: true, label: 'Email' },\n ];\n }\n\n getInputPhoneNumber() {\n return [\n { name: 'phoneNumber', type: 'string', required: true, label: 'Phone Number' },\n ];\n }\n\n canRemediate() {\n return Boolean(this.values.email || this.values.phoneNumber);\n }\n\n getNextStep(context: IdxContext) {\n const common = super.getNextStep();\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n return {\n stateHandle: this.values.stateHandle,\n email: this.values.email,\n phoneNumber: this.values.phoneNumber\n };\n }\n\n getValuesAfterProceed() {\n let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"EnrollmentChannelData.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/EnrollmentChannelData.ts"],"names":["EnrollmentChannelData","Remediator","getInputEmail","name","type","required","label","getInputPhoneNumber","canRemediate","Boolean","email","phoneNumber","getNextStep","context","common","authenticator","currentAuthenticator","value","getData","stateHandle","getValuesAfterProceed","trimmedValues","valueKey","values"],"mappings":";;;;;;;;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,qBAAN,SAAoCC,sBAApC,CAA+C;AAKpDC,EAAAA,aAAa,GAAG;AACd,WAAO,CACL;AAAEC,MAAAA,IAAI,EAAE,OAAR;AAAiBC,MAAAA,IAAI,EAAE,QAAvB;AAAiCC,MAAAA,QAAQ,EAAE,IAA3C;AAAiDC,MAAAA,KAAK,EAAE;AAAxD,KADK,CAAP;AAGD;;AAEDC,EAAAA,mBAAmB,GAAG;AACpB,WAAO,CACL;AAAEJ,MAAAA,IAAI,EAAE,aAAR;AAAuBC,MAAAA,IAAI,EAAE,QAA7B;AAAuCC,MAAAA,QAAQ,EAAE,IAAjD;AAAuDC,MAAAA,KAAK,EAAE;AAA9D,KADK,CAAP;AAGD;;AAEDE,EAAAA,YAAY,GAAG;AACb,WAAOC,OAAO,CAAC,2BAAYC,KAAZ,IAAqB,2BAAYC,WAAlC,CAAd;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAsB;AAC/B,UAAMC,MAAM,GAAG,MAAMF,WAAN,EAAf;AACA,UAAMG,aAAa,GAAGF,OAAO,CAACG,oBAAR,CAA6BC,KAAnD;AACA,WAAO,EACL,GAAGH,MADE;AAELC,MAAAA;AAFK,KAAP;AAID;;AAEDG,EAAAA,OAAO,GAAG;AACR,WAAO;AACLC,MAAAA,WAAW,EAAE,2BAAYA,WADpB;AAELT,MAAAA,KAAK,EAAE,2BAAYA,KAFd;AAGLC,MAAAA,WAAW,EAAE,2BAAYA;AAHpB,KAAP;AAKD;;AAEDS,EAAAA,qBAAqB,GAAG;AAAA;;AACtB,QAAIC,aAAa,GAAG,wEAAY,IAAZ,mBAAgCC,QAAQ;AAAA;;AAAA,aAAI,CAAC,oCAAC,OAAD,EAAU,aAAV,mBAAkCA,QAAlC,CAAL;AAAA,KAAxC,CAApB;AACA,WAAO,qBAAAD,aAAa,MAAb,CAAAA,aAAa,EAAQ,CAACE,MAAD,EAASD,QAAT,MAAuB,EAAC,GAAGC,MAAJ;AAAY,OAACD,QAAD,GAAY,2BAAYA,QAAZ;AAAxB,KAAvB,CAAR,EAAgF,EAAhF,CAApB;AACD;;AAzCmD;;;8BAAzCtB,qB,qBACc,yB","sourcesContent":["/*!\n * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\nimport { IdxContext } from '../types/idx-js';\n\n\nexport type EnrollmentChannelDataValues = RemediationValues & {\n email?: string;\n phoneNumber?: string;\n};\n\nexport class EnrollmentChannelData extends Remediator {\n static remediationName = 'enrollment-channel-data';\n\n values!: EnrollmentChannelDataValues;\n\n getInputEmail() {\n return [\n { name: 'email', type: 'string', required: true, label: 'Email' },\n ];\n }\n\n getInputPhoneNumber() {\n return [\n { name: 'phoneNumber', type: 'string', required: true, label: 'Phone Number' },\n ];\n }\n\n canRemediate() {\n return Boolean(this.values.email || this.values.phoneNumber);\n }\n\n getNextStep(context: IdxContext) {\n const common = super.getNextStep();\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n authenticator,\n };\n }\n\n getData() {\n return {\n stateHandle: this.values.stateHandle,\n email: this.values.email,\n phoneNumber: this.values.phoneNumber\n };\n }\n\n getValuesAfterProceed() {\n let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"EnrollmentChannelData.js"}
@@ -25,9 +25,7 @@ class Identify extends _Remediator.Remediator {
25
25
  constructor(...args) {
26
26
  super(...args);
27
27
  (0, _defineProperty2.default)(this, "map", {
28
- 'identifier': ['username'],
29
- 'credentials': [],
30
- 'rememberMe': ['rememberMe']
28
+ 'identifier': ['username']
31
29
  });
32
30
  }
33
31
 
@@ -39,8 +37,17 @@ class Identify extends _Remediator.Remediator {
39
37
  }
40
38
 
41
39
  mapCredentials() {
42
- return {
43
- passcode: (0, _values.default)(this).password
40
+ const {
41
+ credentials,
42
+ password
43
+ } = (0, _values.default)(this);
44
+
45
+ if (!credentials && !password) {
46
+ return;
47
+ }
48
+
49
+ return credentials || {
50
+ passcode: password
44
51
  };
45
52
  }
46
53
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Identify.ts"],"names":["Identify","Remediator","canRemediate","identifier","getData","mapCredentials","passcode","password","getInputCredentials","input","form","value","name","required"],"mappings":";;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUO,MAAMA,QAAN,SAAuBC,sBAAvB,CAAkC;AAAA;AAAA;AAAA,+CAKjC;AACJ,oBAAc,CAAC,UAAD,CADV;AAEJ,qBAAe,EAFX;AAGJ,oBAAc,CAAC,YAAD;AAHV,KALiC;AAAA;;AAWvCC,EAAAA,YAAY,GAAG;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAiB,KAAKC,OAAL,EAAvB;AACA,WAAO,CAAC,CAACD,UAAT;AACD;;AAEDE,EAAAA,cAAc,GAAG;AACf,WAAO;AAAEC,MAAAA,QAAQ,EAAE,2BAAYC;AAAxB,KAAP;AACD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,EACL,GAAGA,KAAK,CAACC,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADE;AAELC,MAAAA,IAAI,EAAE,UAFD;AAGLC,MAAAA,QAAQ,EAAEJ,KAAK,CAACI;AAHX,KAAP;AAKD;;AA1BsC;;;8BAA5Bb,Q,qBACc,U","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface IdentifyValues extends RemediationValues {\n username?: string;\n password?: string;\n}\n\nexport class Identify extends Remediator {\n static remediationName = 'identify';\n\n values!: IdentifyValues;\n\n map = {\n 'identifier': ['username'],\n 'credentials': [],\n 'rememberMe': ['rememberMe'],\n };\n\n canRemediate() {\n const { identifier } = this.getData();\n return !!identifier;\n }\n\n mapCredentials() {\n return { passcode: this.values.password };\n }\n\n getInputCredentials(input) {\n return {\n ...input.form.value[0],\n name: 'password',\n required: input.required\n };\n }\n\n}\n"],"file":"Identify.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/Identify.ts"],"names":["Identify","Remediator","canRemediate","identifier","getData","mapCredentials","credentials","password","passcode","getInputCredentials","input","form","value","name","required"],"mappings":";;;;;;;;;;AAcA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,QAAN,SAAuBC,sBAAvB,CAAkC;AAAA;AAAA;AAAA,+CAKjC;AACJ,oBAAc,CAAC,UAAD;AADV,KALiC;AAAA;;AASvCC,EAAAA,YAAY,GAAG;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAiB,KAAKC,OAAL,EAAvB;AACA,WAAO,CAAC,CAACD,UAAT;AACD;;AAEDE,EAAAA,cAAc,GAAG;AACf,UAAM;AAAEC,MAAAA,WAAF;AAAeC,MAAAA;AAAf,6BAA4B,IAA5B,CAAN;;AACA,QAAI,CAACD,WAAD,IAAgB,CAACC,QAArB,EAA+B;AAC7B;AACD;;AACD,WAAOD,WAAW,IAAI;AAAEE,MAAAA,QAAQ,EAAED;AAAZ,KAAtB;AACD;;AAEDE,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,EACL,GAAGA,KAAK,CAACC,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADE;AAELC,MAAAA,IAAI,EAAE,UAFD;AAGLC,MAAAA,QAAQ,EAAEJ,KAAK,CAACI;AAHX,KAAP;AAKD;;AA5BsC;;;8BAA5Bd,Q,qBACc,U","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Credentials } from '../authenticator';\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface IdentifyValues extends RemediationValues {\n username?: string;\n password?: string;\n credentials?: Credentials;\n}\n\nexport class Identify extends Remediator {\n static remediationName = 'identify';\n\n values!: IdentifyValues;\n\n map = {\n 'identifier': ['username']\n };\n\n canRemediate() {\n const { identifier } = this.getData();\n return !!identifier;\n }\n\n mapCredentials() {\n const { credentials, password } = this.values;\n if (!credentials && !password) {\n return;\n }\n return credentials || { passcode: password };\n }\n\n getInputCredentials(input) {\n return {\n ...input.form.value[0],\n name: 'password',\n required: input.required\n };\n }\n\n}\n"],"file":"Identify.js"}
@@ -22,16 +22,17 @@ var _Remediator = require("./Base/Remediator");
22
22
  * See the License for the specific language governing permissions and limitations under the License.
23
23
  */
24
24
  class ReEnrollAuthenticator extends _Remediator.Remediator {
25
- constructor(...args) {
26
- super(...args);
27
- (0, _defineProperty2.default)(this, "map", {
28
- 'credentials': []
29
- });
30
- }
31
-
32
25
  mapCredentials() {
26
+ const {
27
+ newPassword
28
+ } = (0, _values.default)(this);
29
+
30
+ if (!newPassword) {
31
+ return;
32
+ }
33
+
33
34
  return {
34
- passcode: (0, _values.default)(this).newPassword
35
+ passcode: newPassword
35
36
  };
36
37
  }
37
38
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ReEnrollAuthenticator.ts"],"names":["ReEnrollAuthenticator","Remediator","mapCredentials","passcode","newPassword","getInputCredentials","input","challengeType","getAuthenticator","type","name","form","value"],"mappings":";;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMA,qBAAN,SAAoCC,sBAApC,CAA+C;AAAA;AAAA;AAAA,+CAK9C;AACJ,qBAAe;AADX,KAL8C;AAAA;;AASpDC,EAAAA,cAAc,GAAG;AACf,WAAO;AACLC,MAAAA,QAAQ,EAAE,2BAAYC;AADjB,KAAP;AAGD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB;AACA,UAAMC,aAAa,GAAG,KAAKC,gBAAL,GAAyBC,IAA/C;AACA,UAAMC,IAAI,GAAGH,aAAa,KAAK,UAAlB,GAA+B,aAA/B,GAA+C,kBAA5D;AACA,WAAO,EACL,GAAGD,KAAK,CAACK,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADE;AAELF,MAAAA;AAFK,KAAP;AAID;;AAvBmD;;;8BAAzCV,qB,qBACc,wB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface ReEnrollAuthenticatorValues extends RemediationValues {\n newPassword?: string;\n}\n\nexport class ReEnrollAuthenticator extends Remediator {\n static remediationName = 'reenroll-authenticator';\n\n values!: ReEnrollAuthenticatorValues;\n\n map = {\n 'credentials': []\n };\n\n mapCredentials() {\n return { \n passcode: this.values.newPassword,\n };\n }\n\n getInputCredentials(input) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const challengeType = this.getAuthenticator()!.type;\n const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';\n return {\n ...input.form.value[0],\n name\n };\n }\n\n}\n"],"file":"ReEnrollAuthenticator.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/ReEnrollAuthenticator.ts"],"names":["ReEnrollAuthenticator","Remediator","mapCredentials","newPassword","passcode","getInputCredentials","input","challengeType","getAuthenticator","type","name","form","value"],"mappings":";;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMA,qBAAN,SAAoCC,sBAApC,CAA+C;AAKpDC,EAAAA,cAAc,GAAG;AACf,UAAM;AAAEC,MAAAA;AAAF,6BAAkB,IAAlB,CAAN;;AACA,QAAI,CAACA,WAAL,EAAkB;AAChB;AACD;;AACD,WAAO;AACLC,MAAAA,QAAQ,EAAED;AADL,KAAP;AAGD;;AAEDE,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB;AACA,UAAMC,aAAa,GAAG,KAAKC,gBAAL,GAAyBC,IAA/C;AACA,UAAMC,IAAI,GAAGH,aAAa,KAAK,UAAlB,GAA+B,aAA/B,GAA+C,kBAA5D;AACA,WAAO,EACL,GAAGD,KAAK,CAACK,IAAN,CAAWC,KAAX,CAAiB,CAAjB,CADE;AAELF,MAAAA;AAFK,KAAP;AAID;;AAvBmD;;;8BAAzCV,qB,qBACc,wB","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface ReEnrollAuthenticatorValues extends RemediationValues {\n newPassword?: string;\n}\n\nexport class ReEnrollAuthenticator extends Remediator {\n static remediationName = 'reenroll-authenticator';\n\n values!: ReEnrollAuthenticatorValues;\n\n mapCredentials() {\n const { newPassword } = this.values;\n if (!newPassword) {\n return;\n }\n return { \n passcode: newPassword,\n };\n }\n\n getInputCredentials(input) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const challengeType = this.getAuthenticator()!.type;\n const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';\n return {\n ...input.form.value[0],\n name\n };\n }\n\n}\n"],"file":"ReEnrollAuthenticator.js"}
@@ -26,16 +26,17 @@ var _types = require("../types");
26
26
  * See the License for the specific language governing permissions and limitations under the License.
27
27
  */
28
28
  class SelectAuthenticatorAuthenticate extends _SelectAuthenticator.SelectAuthenticator {
29
- constructor(remediation, values = {}) {
29
+ constructor(remediation, values = {}, options = {}) {
30
30
  var _getAuthenticatorFrom;
31
31
 
32
- super(remediation, values); // Preset password authenticator to trigger recover action
32
+ super(remediation, values, options); // Preset password authenticator to trigger recover action
33
33
 
34
+ const isRecoveryFlow = this.options.flow === 'recoverPassword';
34
35
  const hasPasswordInOptions = (_getAuthenticatorFrom = (0, _util.getAuthenticatorFromRemediation)(remediation).options) === null || _getAuthenticatorFrom === void 0 ? void 0 : _getAuthenticatorFrom.some(({
35
36
  relatesTo
36
37
  }) => (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.key) === _types.AuthenticatorKey.OKTA_PASSWORD);
37
38
 
38
- if (hasPasswordInOptions && ((0, _values.default)(this).flow === 'recoverPassword' || (0, _values.default)(this).password)) {
39
+ if (hasPasswordInOptions && (isRecoveryFlow || (0, _values.default)(this).password)) {
39
40
  (0, _values.default)(this).authenticators = [...((0, _values.default)(this).authenticators || []), {
40
41
  key: _types.AuthenticatorKey.OKTA_PASSWORD
41
42
  }];
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorAuthenticate.ts"],"names":["SelectAuthenticatorAuthenticate","SelectAuthenticator","constructor","remediation","values","hasPasswordInOptions","options","some","relatesTo","key","AuthenticatorKey","OKTA_PASSWORD","flow","password","authenticators"],"mappings":";;;;;;;;;;AAaA;;AACA;;AAEA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,+BAAN,SAA8CC,wCAA9C,CAAkE;AAIvEC,EAAAA,WAAW,CAACC,WAAD,EAA8BC,MAAiC,GAAG,EAAlE,EAAsE;AAAA;;AAC/E,UAAMD,WAAN,EAAmBC,MAAnB,EAD+E,CAG/E;;AACA,UAAMC,oBAAoB,4BAAG,2CAAgCF,WAAhC,EAC1BG,OADuB,0DAAG,sBACjBC,IADiB,CACZ,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAmB,CAAAA,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEC,GAAX,MAAmBC,wBAAiBC,aAD3C,CAA7B;;AAEA,QAAIN,oBAAoB,KAAK,2BAAYO,IAAZ,KAAqB,iBAArB,IAA0C,2BAAYC,QAA3D,CAAxB,EAA8F;AAC5F,iCAAYC,cAAZ,GAA6B,CAC3B,IAAG,2BAAYA,cAAZ,IAA8B,EAAjC,CAD2B,EAE3B;AAAEL,QAAAA,GAAG,EAAEC,wBAAiBC;AAAxB,OAF2B,CAA7B;AAID;AACF;;AAhBsE;;;8BAA5DX,+B,qBACc,mC","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { getAuthenticatorFromRemediation } from './util';\nimport { IdxRemediation } from '../types/idx-js';\nimport { AuthenticatorKey, Authenticator } from '../types';\n\nexport type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {\n password?: string;\n};\n\nexport class SelectAuthenticatorAuthenticate extends SelectAuthenticator {\n static remediationName = 'select-authenticator-authenticate';\n values!: SelectAuthenticatorAuthenticateValues;\n\n constructor(remediation: IdxRemediation, values: SelectAuthenticatorValues = {}) {\n super(remediation, values);\n\n // Preset password authenticator to trigger recover action\n const hasPasswordInOptions = getAuthenticatorFromRemediation(remediation)\n .options?.some(({ relatesTo }) => relatesTo?.key === AuthenticatorKey.OKTA_PASSWORD);\n if (hasPasswordInOptions && (this.values.flow === 'recoverPassword' || this.values.password)) {\n this.values.authenticators = [\n ...this.values.authenticators || [],\n { key: AuthenticatorKey.OKTA_PASSWORD }\n ] as Authenticator[];\n }\n }\n}\n"],"file":"SelectAuthenticatorAuthenticate.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorAuthenticate.ts"],"names":["SelectAuthenticatorAuthenticate","SelectAuthenticator","constructor","remediation","values","options","isRecoveryFlow","flow","hasPasswordInOptions","some","relatesTo","key","AuthenticatorKey","OKTA_PASSWORD","password","authenticators"],"mappings":";;;;;;;;;;AAaA;;AACA;;AAEA;;AAhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAYO,MAAMA,+BAAN,SAA8CC,wCAA9C,CAAkE;AAIvEC,EAAAA,WAAW,CAACC,WAAD,EAA8BC,MAAiC,GAAG,EAAlE,EAAsEC,OAAyB,GAAG,EAAlG,EAAsG;AAAA;;AAC/G,UAAMF,WAAN,EAAmBC,MAAnB,EAA2BC,OAA3B,EAD+G,CAG/G;;AACA,UAAMC,cAAc,GAAG,KAAKD,OAAL,CAAaE,IAAb,KAAsB,iBAA7C;AACA,UAAMC,oBAAoB,4BAAG,2CAAgCL,WAAhC,EAC1BE,OADuB,0DAAG,sBACjBI,IADiB,CACZ,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAmB,CAAAA,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEC,GAAX,MAAmBC,wBAAiBC,aAD3C,CAA7B;;AAEA,QAAIL,oBAAoB,KAAKF,cAAc,IAAI,2BAAYQ,QAAnC,CAAxB,EAAsE;AACpE,iCAAYC,cAAZ,GAA6B,CAC3B,IAAG,2BAAYA,cAAZ,IAA8B,EAAjC,CAD2B,EAE3B;AAAEJ,QAAAA,GAAG,EAAEC,wBAAiBC;AAAxB,OAF2B,CAA7B;AAID;AACF;;AAjBsE;;;8BAA5Db,+B,qBACc,mC","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { getAuthenticatorFromRemediation } from './util';\nimport { IdxRemediation } from '../types/idx-js';\nimport { AuthenticatorKey, Authenticator, RemediateOptions } from '../types';\n\nexport type SelectAuthenticatorAuthenticateValues = SelectAuthenticatorValues & {\n password?: string;\n};\n\nexport class SelectAuthenticatorAuthenticate extends SelectAuthenticator {\n static remediationName = 'select-authenticator-authenticate';\n values!: SelectAuthenticatorAuthenticateValues;\n\n constructor(remediation: IdxRemediation, values: SelectAuthenticatorValues = {}, options: RemediateOptions = {}) {\n super(remediation, values, options);\n\n // Preset password authenticator to trigger recover action\n const isRecoveryFlow = this.options.flow === 'recoverPassword';\n const hasPasswordInOptions = getAuthenticatorFromRemediation(remediation)\n .options?.some(({ relatesTo }) => relatesTo?.key === AuthenticatorKey.OKTA_PASSWORD);\n if (hasPasswordInOptions && (isRecoveryFlow || this.values.password)) {\n this.values.authenticators = [\n ...this.values.authenticators || [],\n { key: AuthenticatorKey.OKTA_PASSWORD }\n ] as Authenticator[];\n }\n }\n}\n"],"file":"SelectAuthenticatorAuthenticate.js"}
@@ -27,7 +27,6 @@ class SelectAuthenticatorUnlockAccount extends _SelectAuthenticator.SelectAuthen
27
27
  constructor(...args) {
28
28
  super(...args);
29
29
  (0, _defineProperty2.default)(this, "map", {
30
- authenticator: [],
31
30
  identifier: ['username']
32
31
  });
33
32
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts"],"names":["SelectAuthenticatorUnlockAccount","SelectAuthenticator","authenticator","identifier","canRemediate","getData","mapAuthenticator","remediationValue","authenticatorMap","methodTypeOption","selectedOption","value","form","name","methodTypeValue","methodType","options","getInputUsername","key"],"mappings":";;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaO,MAAMA,gCAAN,SAA+CC,wCAA/C,CAAmE;AAAA;AAAA;AAAA,+CAKlE;AACJC,MAAAA,aAAa,EAAE,EADX;AAEJC,MAAAA,UAAU,EAAE,CAAC,UAAD;AAFR,KALkE;AAAA;;AAUxEC,EAAAA,YAAY,GAAG;AACb,UAAMD,UAAU,GAAG,KAAKE,OAAL,CAAa,YAAb,CAAnB;AACA,WAAO,CAAC,CAACF,UAAF,IAAgB,MAAMC,YAAN,EAAvB;AACD;;AAEDE,EAAAA,gBAAgB,CAACC,gBAAD,EAAwC;AAAA;;AACtD,UAAMC,gBAAgB,GAAG,MAAMF,gBAAN,CAAuBC,gBAAvB,CAAzB;AACA,UAAME,gBAAgB,2BAAG,KAAKC,cAAR,yDAAG,mDAAqBC,KAArB,CAA2BC,IAA3B,CAAgCD,KAAhC,iBAA2C,CAAC;AAAEE,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,YAAlE,CAAzB,CAFsD,CAItD;AACA;AACA;;AACA,UAAMC,eAAe,GAAG,2BAAYC,UAAZ,KACtBN,gBADsB,aACtBA,gBADsB,uBACtBA,gBAAgB,CAAEE,KADI,MACeF,gBADf,aACeA,gBADf,gDACeA,gBAAgB,CAAEO,OADjC,oFACe,sBAA4B,CAA5B,CADf,2DACe,uBAAgCL,KAD/C,CAAxB;;AAGA,QAAIG,eAAJ,EAAqB;AACnB,aAAO,EACL,GAAGN,gBADE;AAELO,QAAAA,UAAU,EAAED;AAFP,OAAP;AAID;;AAED,WAAON,gBAAP;AACD;;AAEDS,EAAAA,gBAAgB,GAAI;AAClB,WAAO;AAAEJ,MAAAA,IAAI,EAAE,UAAR;AAAoBK,MAAAA,GAAG,EAAE;AAAzB,KAAP;AACD;;AArCuE;;;8BAA7DlB,gC,qBACc,qC","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { Authenticator } from '../../types';\nimport { IdxRemediationValue } from '../types/idx-js';\n\n\nexport type SelectAuthenticatorUnlockAccountValues = SelectAuthenticatorValues & {\n identifier?: string;\n methodType?: string;\n};\n\nexport class SelectAuthenticatorUnlockAccount extends SelectAuthenticator {\n static remediationName = 'select-authenticator-unlock-account';\n values!: SelectAuthenticatorUnlockAccountValues;\n authenticator?: Authenticator;\n\n map = {\n authenticator: [],\n identifier: ['username']\n }\n\n canRemediate() {\n const identifier = this.getData('identifier');\n return !!identifier && super.canRemediate();\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const authenticatorMap = super.mapAuthenticator(remediationValue);\n const methodTypeOption = this.selectedOption?.value.form.value.find(({ name }) => name === 'methodType');\n\n // defaults to 'manually defined' value\n // 2nd: option may have pre-defined value, like stateHandle\n // 3rd: if only a single OV option is available, default to that option\n const methodTypeValue = this.values.methodType ||\n methodTypeOption?.value as string || methodTypeOption?.options?.[0]?.value as string;\n\n if (methodTypeValue) {\n return {\n ...authenticatorMap,\n methodType: methodTypeValue\n };\n }\n\n return authenticatorMap;\n }\n\n getInputUsername () {\n return { name: 'username', key: 'string' };\n }\n\n}\n"],"file":"SelectAuthenticatorUnlockAccount.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorUnlockAccount.ts"],"names":["SelectAuthenticatorUnlockAccount","SelectAuthenticator","identifier","canRemediate","getData","mapAuthenticator","remediationValue","authenticatorMap","methodTypeOption","selectedOption","value","form","name","methodTypeValue","methodType","options","getInputUsername","key"],"mappings":";;;;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaO,MAAMA,gCAAN,SAA+CC,wCAA/C,CAAmE;AAAA;AAAA;AAAA,+CAKlE;AACJC,MAAAA,UAAU,EAAE,CAAC,UAAD;AADR,KALkE;AAAA;;AASxEC,EAAAA,YAAY,GAAG;AACb,UAAMD,UAAU,GAAG,KAAKE,OAAL,CAAa,YAAb,CAAnB;AACA,WAAO,CAAC,CAACF,UAAF,IAAgB,MAAMC,YAAN,EAAvB;AACD;;AAEDE,EAAAA,gBAAgB,CAACC,gBAAD,EAAwC;AAAA;;AACtD,UAAMC,gBAAgB,GAAG,MAAMF,gBAAN,CAAuBC,gBAAvB,CAAzB;AACA,UAAME,gBAAgB,2BAAG,KAAKC,cAAR,yDAAG,mDAAqBC,KAArB,CAA2BC,IAA3B,CAAgCD,KAAhC,iBAA2C,CAAC;AAAEE,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,YAAlE,CAAzB,CAFsD,CAItD;AACA;AACA;;AACA,UAAMC,eAAe,GAAG,2BAAYC,UAAZ,KACtBN,gBADsB,aACtBA,gBADsB,uBACtBA,gBAAgB,CAAEE,KADI,MACeF,gBADf,aACeA,gBADf,gDACeA,gBAAgB,CAAEO,OADjC,oFACe,sBAA4B,CAA5B,CADf,2DACe,uBAAgCL,KAD/C,CAAxB;;AAGA,QAAIG,eAAJ,EAAqB;AACnB,aAAO,EACL,GAAGN,gBADE;AAELO,QAAAA,UAAU,EAAED;AAFP,OAAP;AAID;;AAED,WAAON,gBAAP;AACD;;AAEDS,EAAAA,gBAAgB,GAAI;AAClB,WAAO;AAAEJ,MAAAA,IAAI,EAAE,UAAR;AAAoBK,MAAAA,GAAG,EAAE;AAAzB,KAAP;AACD;;AApCuE;;;8BAA7DjB,gC,qBACc,qC","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { SelectAuthenticator, SelectAuthenticatorValues } from './Base/SelectAuthenticator';\nimport { Authenticator } from '../../types';\nimport { IdxRemediationValue } from '../types/idx-js';\n\n\nexport type SelectAuthenticatorUnlockAccountValues = SelectAuthenticatorValues & {\n identifier?: string;\n methodType?: string;\n};\n\nexport class SelectAuthenticatorUnlockAccount extends SelectAuthenticator {\n static remediationName = 'select-authenticator-unlock-account';\n values!: SelectAuthenticatorUnlockAccountValues;\n authenticator?: Authenticator;\n\n map = {\n identifier: ['username']\n }\n\n canRemediate() {\n const identifier = this.getData('identifier');\n return !!identifier && super.canRemediate();\n }\n\n mapAuthenticator(remediationValue: IdxRemediationValue) {\n const authenticatorMap = super.mapAuthenticator(remediationValue);\n const methodTypeOption = this.selectedOption?.value.form.value.find(({ name }) => name === 'methodType');\n\n // defaults to 'manually defined' value\n // 2nd: option may have pre-defined value, like stateHandle\n // 3rd: if only a single OV option is available, default to that option\n const methodTypeValue = this.values.methodType ||\n methodTypeOption?.value as string || methodTypeOption?.options?.[0]?.value as string;\n\n if (methodTypeValue) {\n return {\n ...authenticatorMap,\n methodType: methodTypeValue\n };\n }\n\n return authenticatorMap;\n }\n\n getInputUsername () {\n return { name: 'username', key: 'string' };\n }\n\n}\n"],"file":"SelectAuthenticatorUnlockAccount.js"}
@@ -22,15 +22,8 @@ var _Remediator = require("./Base/Remediator");
22
22
  * See the License for the specific language governing permissions and limitations under the License.
23
23
  */
24
24
  class Skip extends _Remediator.Remediator {
25
- constructor(...args) {
26
- super(...args);
27
- (0, _defineProperty2.default)(this, "map", {
28
- skip: ['skip']
29
- });
30
- }
31
-
32
25
  canRemediate() {
33
- return !!(0, _values.default)(this).skip;
26
+ return !!(0, _values.default)(this).skip || this.options.step === 'skip';
34
27
  }
35
28
 
36
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Skip.ts"],"names":["Skip","Remediator","skip","canRemediate"],"mappings":";;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMA,IAAN,SAAmBC,sBAAnB,CAA8B;AAAA;AAAA;AAAA,+CAK7B;AACJC,MAAAA,IAAI,EAAE,CAAC,MAAD;AADF,KAL6B;AAAA;;AASnCC,EAAAA,YAAY,GAAG;AACb,WAAO,CAAC,CAAC,2BAAYD,IAArB;AACD;;AAXkC;;;8BAAxBF,I,qBACc,M","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface SkipValues extends RemediationValues {\n skip?: boolean;\n}\n\nexport class Skip extends Remediator {\n static remediationName = 'skip';\n\n values!: SkipValues;\n\n map = {\n skip: ['skip']\n }\n\n canRemediate() {\n return !!this.values.skip;\n }\n\n}\n"],"file":"Skip.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/Skip.ts"],"names":["Skip","Remediator","canRemediate","skip","options","step"],"mappings":";;;;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASO,MAAMA,IAAN,SAAmBC,sBAAnB,CAA8B;AAKnCC,EAAAA,YAAY,GAAG;AACb,WAAO,CAAC,CAAC,2BAAYC,IAAd,IAAsB,KAAKC,OAAL,CAAaC,IAAb,KAAsB,MAAnD;AACD;;AAPkC;;;8BAAxBL,I,qBACc,M","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { Remediator, RemediationValues } from './Base/Remediator';\n\nexport interface SkipValues extends RemediationValues {\n skip?: boolean;\n}\n\nexport class Skip extends Remediator {\n static remediationName = 'skip';\n\n values!: SkipValues;\n\n canRemediate() {\n return !!this.values.skip || this.options.step === 'skip';\n }\n\n}\n"],"file":"Skip.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/util.ts"],"names":["getAllValues","idxRemediation","value","r","name","getRequiredValues","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,SAASA,YAAT,CAAsBC,cAAtB,EAAsD;AAAA;;AAC3D,kCAAOA,cAAc,CAACC,KAAtB,0DAAO,qEAA0BC,CAAC,IAAIA,CAAC,CAACC,IAAjC,CAAP;AACD;;AAEM,SAASC,iBAAT,CAA2BJ,cAA3B,EAA2D;AAAA;;AAChE,mCAAOA,cAAc,CAACC,KAAtB,2DAAO,0EAA6B,CAACI,QAAD,EAAWC,GAAX,KAAmB;AACrD,QAAIA,GAAG,CAACD,QAAR,EAAkB;AAChBA,MAAAA,QAAQ,CAACE,IAAT,CAAcD,GAAG,CAACH,IAAlB;AACD;;AACD,WAAOE,QAAP;AACD,GALM,EAKJ,EALI,CAAP;AAMD;;AAEM,SAASG,SAAT,CAAmBC,GAAnB,EAAgC;AACrC,SAAOA,GAAG,CAACC,MAAJ,CAAW,CAAX,EAAcC,WAAd,KAA8BF,GAAG,CAACG,SAAJ,CAAc,CAAd,CAArC;AACD;;AAEM,SAASC,+BAAT,CACLC,WADK,EAEgB;AAAA;;AACrB;AACA,SAAO,8BAAAA,WAAW,CAACb,KAAZ,iBAAwB,CAAC;AAAEE,IAAAA;AAAF,GAAD,KAAcA,IAAI,KAAK,eAA/C,CAAP;AACD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n\nimport { IdxRemediation, IdxRemediationValue } from '../types/idx-js';\n\nexport function getAllValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.map(r => r.name);\n}\n\nexport function getRequiredValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name as never);\n }\n return required;\n }, []);\n}\n\nexport function titleCase(str: string) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function getAuthenticatorFromRemediation(\n remediation: IdxRemediation\n): IdxRemediationValue {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return remediation.value!.find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n}\n"],"file":"util.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/util.ts"],"names":["getAllValues","idxRemediation","value","r","name","getRequiredValues","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIO,SAASA,YAAT,CAAsBC,cAAtB,EAAsD;AAAA;;AAC3D,kCAAOA,cAAc,CAACC,KAAtB,0DAAO,qEAA0BC,CAAC,IAAIA,CAAC,CAACC,IAAjC,CAAP;AACD;;AAEM,SAASC,iBAAT,CAA2BJ,cAA3B,EAA2D;AAAA;;AAChE,mCAAOA,cAAc,CAACC,KAAtB,2DAAO,0EAA6B,CAACI,QAAD,EAAWC,GAAX,KAAmB;AACrD,QAAIA,GAAG,CAACD,QAAR,EAAkB;AAChBA,MAAAA,QAAQ,CAACE,IAAT,CAAcD,GAAG,CAACH,IAAlB;AACD;;AACD,WAAOE,QAAP;AACD,GALM,EAKJ,EALI,CAAP;AAMD;;AAEM,SAASG,SAAT,CAAmBC,GAAnB,EAAgC;AACrC,SAAOA,GAAG,CAACC,MAAJ,CAAW,CAAX,EAAcC,WAAd,KAA8BF,GAAG,CAACG,SAAJ,CAAc,CAAd,CAArC;AACD;;AAEM,SAASC,+BAAT,CACLC,WADK,EAEgB;AAAA;;AACrB;AACA,SAAO,8BAAAA,WAAW,CAACb,KAAZ,iBAAwB,CAAC;AAAEE,IAAAA;AAAF,GAAD,KAAcA,IAAI,KAAK,eAA/C,CAAP;AACD","sourcesContent":["/*!\n * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * \n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IdxRemediation, IdxRemediationValue } from '../types/idx-js';\n\nexport function getAllValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.map(r => r.name);\n}\n\nexport function getRequiredValues(idxRemediation: IdxRemediation) {\n return idxRemediation.value?.reduce((required, cur) => {\n if (cur.required) {\n required.push(cur.name as never);\n }\n return required;\n }, []);\n}\n\nexport function titleCase(str: string) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n}\n\nexport function getAuthenticatorFromRemediation(\n remediation: IdxRemediation\n): IdxRemediationValue {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return remediation.value!.find(({ name }) => name === 'authenticator') as IdxRemediationValue;\n}\n"],"file":"util.js"}