@okta/okta-auth-js 5.11.0 → 6.0.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 (228) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -2
  3. package/cjs/AuthStateManager.js +2 -1
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +75 -71
  6. package/cjs/OktaAuth.js.map +1 -1
  7. package/cjs/OktaUserAgent.js +2 -2
  8. package/cjs/OktaUserAgent.js.map +1 -1
  9. package/cjs/PromiseQueue.js +6 -1
  10. package/cjs/PromiseQueue.js.map +1 -1
  11. package/cjs/StorageManager.js +3 -1
  12. package/cjs/StorageManager.js.map +1 -1
  13. package/cjs/TokenManager.js +9 -3
  14. package/cjs/TokenManager.js.map +1 -1
  15. package/cjs/TransactionManager.js +17 -4
  16. package/cjs/TransactionManager.js.map +1 -1
  17. package/cjs/browser/browserStorage.js +7 -5
  18. package/cjs/browser/browserStorage.js.map +1 -1
  19. package/cjs/browser/fingerprint.js +3 -1
  20. package/cjs/browser/fingerprint.js.map +1 -1
  21. package/cjs/builderUtil.js +3 -17
  22. package/cjs/builderUtil.js.map +1 -1
  23. package/cjs/crypto/oidcHash.js.map +1 -1
  24. package/cjs/features.js +9 -3
  25. package/cjs/features.js.map +1 -1
  26. package/cjs/fetch/fetchRequest.js +2 -1
  27. package/cjs/fetch/fetchRequest.js.map +1 -1
  28. package/cjs/http/request.js +2 -0
  29. package/cjs/http/request.js.map +1 -1
  30. package/cjs/idx/authenticate.js +8 -5
  31. package/cjs/idx/authenticate.js.map +1 -1
  32. package/cjs/idx/authenticator/SecurityQuestionVerification.js +1 -0
  33. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  34. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +2 -2
  35. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  36. package/cjs/idx/authenticator/getAuthenticator.js +5 -6
  37. package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
  38. package/cjs/idx/cancel.js.map +1 -1
  39. package/cjs/idx/emailVerify.js +73 -0
  40. package/cjs/idx/emailVerify.js.map +1 -0
  41. package/cjs/idx/flow/FlowSpecification.js +16 -4
  42. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  43. package/cjs/idx/flow/RegistrationFlow.js +2 -0
  44. package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
  45. package/cjs/idx/handleInteractionCodeRedirect.js +1 -0
  46. package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
  47. package/cjs/idx/index.js +13 -0
  48. package/cjs/idx/index.js.map +1 -1
  49. package/cjs/idx/interact.js +46 -34
  50. package/cjs/idx/interact.js.map +1 -1
  51. package/cjs/idx/introspect.js +12 -14
  52. package/cjs/idx/introspect.js.map +1 -1
  53. package/cjs/idx/proceed.js +4 -7
  54. package/cjs/idx/proceed.js.map +1 -1
  55. package/cjs/idx/recoverPassword.js +1 -1
  56. package/cjs/idx/recoverPassword.js.map +1 -1
  57. package/cjs/idx/register.js +6 -15
  58. package/cjs/idx/register.js.map +1 -1
  59. package/cjs/idx/remediate.js +21 -5
  60. package/cjs/idx/remediate.js.map +1 -1
  61. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +2 -0
  62. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  63. package/cjs/idx/remediators/AuthenticatorVerificationData.js +5 -3
  64. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  65. package/cjs/idx/remediators/Base/AuthenticatorData.js +5 -3
  66. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  67. package/cjs/idx/remediators/Base/Remediator.js +2 -0
  68. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  69. package/cjs/idx/remediators/Base/SelectAuthenticator.js +4 -3
  70. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  71. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  72. package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
  73. package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
  74. package/cjs/idx/remediators/EnrollPoll.js +2 -3
  75. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  76. package/cjs/idx/remediators/EnrollProfile.js +4 -1
  77. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  78. package/cjs/idx/remediators/EnrollmentChannelData.js +80 -0
  79. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -0
  80. package/cjs/idx/remediators/Identify.js.map +1 -1
  81. package/cjs/idx/remediators/ReEnrollAuthenticator.js +1 -0
  82. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  83. package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
  84. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +2 -2
  85. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  86. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
  87. package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
  88. package/cjs/idx/remediators/SelectEnrollmentChannel.js +74 -0
  89. package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -0
  90. package/cjs/idx/remediators/Skip.js.map +1 -1
  91. package/cjs/idx/remediators/index.js +26 -0
  92. package/cjs/idx/remediators/index.js.map +1 -1
  93. package/cjs/idx/remediators/util.js +7 -2
  94. package/cjs/idx/remediators/util.js.map +1 -1
  95. package/cjs/idx/run.js +111 -45
  96. package/cjs/idx/run.js.map +1 -1
  97. package/cjs/idx/startTransaction.js +4 -2
  98. package/cjs/idx/startTransaction.js.map +1 -1
  99. package/cjs/idx/transactionMeta.js +82 -69
  100. package/cjs/idx/transactionMeta.js.map +1 -1
  101. package/cjs/idx/types/idx-js.js.map +1 -1
  102. package/cjs/idx/types/index.js +19 -3
  103. package/cjs/idx/types/index.js.map +1 -1
  104. package/cjs/index.js +14 -0
  105. package/cjs/index.js.map +1 -1
  106. package/cjs/oidc/endpoints/authorize.js +2 -0
  107. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  108. package/cjs/oidc/endpoints/token.js +1 -0
  109. package/cjs/oidc/endpoints/token.js.map +1 -1
  110. package/cjs/oidc/exchangeCodeForTokens.js +3 -3
  111. package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
  112. package/cjs/oidc/getToken.js +3 -1
  113. package/cjs/oidc/getToken.js.map +1 -1
  114. package/cjs/oidc/getWithRedirect.js +10 -37
  115. package/cjs/oidc/getWithRedirect.js.map +1 -1
  116. package/cjs/oidc/handleOAuthResponse.js +80 -86
  117. package/cjs/oidc/handleOAuthResponse.js.map +1 -1
  118. package/cjs/oidc/parseFromUrl.js.map +1 -1
  119. package/cjs/oidc/renewToken.js.map +1 -1
  120. package/cjs/oidc/renewTokens.js +1 -1
  121. package/cjs/oidc/renewTokens.js.map +1 -1
  122. package/cjs/oidc/revokeToken.js +28 -29
  123. package/cjs/oidc/revokeToken.js.map +1 -1
  124. package/cjs/oidc/util/index.js +14 -0
  125. package/cjs/oidc/util/index.js.map +1 -1
  126. package/cjs/oidc/util/loginRedirect.js +6 -1
  127. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  128. package/cjs/oidc/util/oauth.js.map +1 -1
  129. package/cjs/oidc/util/oauthMeta.js +36 -0
  130. package/cjs/oidc/util/oauthMeta.js.map +1 -0
  131. package/cjs/oidc/util/pkce.js.map +1 -1
  132. package/cjs/oidc/util/prepareTokenParams.js +57 -36
  133. package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
  134. package/cjs/oidc/util/validateClaims.js +2 -0
  135. package/cjs/oidc/util/validateClaims.js.map +1 -1
  136. package/cjs/oidc/verifyToken.js +2 -1
  137. package/cjs/oidc/verifyToken.js.map +1 -1
  138. package/cjs/options.js +6 -2
  139. package/cjs/options.js.map +1 -1
  140. package/cjs/server/serverStorage.js +1 -1
  141. package/cjs/server/serverStorage.js.map +1 -1
  142. package/cjs/services/TokenService.js +3 -0
  143. package/cjs/services/TokenService.js.map +1 -1
  144. package/cjs/tx/AuthTransaction.js +3 -0
  145. package/cjs/tx/AuthTransaction.js.map +1 -1
  146. package/cjs/tx/TransactionState.js +0 -17
  147. package/cjs/tx/TransactionState.js.map +1 -1
  148. package/cjs/tx/api.js +3 -2
  149. package/cjs/tx/api.js.map +1 -1
  150. package/cjs/types/Transaction.js.map +1 -1
  151. package/cjs/util/index.js +0 -13
  152. package/cjs/util/index.js.map +1 -1
  153. package/cjs/util/url.js.map +1 -1
  154. package/dist/okta-auth-js.min.js +1 -1
  155. package/dist/okta-auth-js.min.js.map +1 -1
  156. package/dist/okta-auth-js.umd.js +1 -1
  157. package/dist/okta-auth-js.umd.js.map +1 -1
  158. package/esm/index.js +1334 -758
  159. package/esm/index.js.map +1 -1
  160. package/lib/AuthStateManager.d.ts +1 -2
  161. package/lib/OktaAuth.d.ts +4 -10
  162. package/lib/StorageManager.d.ts +1 -1
  163. package/lib/TokenManager.d.ts +2 -2
  164. package/lib/TransactionManager.d.ts +3 -2
  165. package/lib/browser/fingerprint.d.ts +1 -1
  166. package/lib/builderUtil.d.ts +1 -2
  167. package/lib/crypto/browser.d.ts +1 -1
  168. package/lib/features.d.ts +1 -1
  169. package/lib/idx/authenticate.d.ts +1 -1
  170. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +1 -1
  171. package/lib/idx/cancel.d.ts +1 -1
  172. package/lib/{util → idx}/emailVerify.d.ts +10 -1
  173. package/lib/idx/flow/FlowSpecification.d.ts +1 -0
  174. package/lib/idx/index.d.ts +1 -0
  175. package/lib/idx/interact.d.ts +4 -11
  176. package/lib/idx/introspect.d.ts +3 -2
  177. package/lib/idx/proceed.d.ts +4 -2
  178. package/lib/idx/recoverPassword.d.ts +1 -1
  179. package/lib/idx/remediate.d.ts +10 -4
  180. package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +3 -3
  181. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +3 -3
  182. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +7 -7
  183. package/lib/idx/remediators/Base/Remediator.d.ts +1 -1
  184. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +7 -7
  185. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +2 -1
  186. package/lib/idx/remediators/EnrollProfile.d.ts +1 -1
  187. package/lib/idx/remediators/EnrollmentChannelData.d.ts +53 -0
  188. package/lib/idx/remediators/Identify.d.ts +2 -2
  189. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -2
  190. package/lib/idx/remediators/RedirectIdp.d.ts +3 -3
  191. package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +39 -0
  192. package/lib/idx/remediators/index.d.ts +2 -0
  193. package/lib/idx/remediators/util.d.ts +2 -2
  194. package/lib/idx/run.d.ts +3 -1
  195. package/lib/idx/startTransaction.d.ts +3 -2
  196. package/lib/idx/transactionMeta.d.ts +6 -27
  197. package/lib/idx/types/idx-js.d.ts +8 -1
  198. package/lib/idx/types/index.d.ts +17 -6
  199. package/lib/index.d.ts +1 -0
  200. package/lib/oidc/exchangeCodeForTokens.d.ts +12 -0
  201. package/lib/oidc/getWithRedirect.d.ts +1 -1
  202. package/lib/oidc/handleOAuthResponse.d.ts +1 -1
  203. package/lib/oidc/parseFromUrl.d.ts +1 -1
  204. package/lib/oidc/renewToken.d.ts +1 -1
  205. package/lib/oidc/renewTokens.d.ts +1 -1
  206. package/lib/oidc/util/browser.d.ts +1 -1
  207. package/lib/oidc/util/errors.d.ts +1 -1
  208. package/lib/oidc/util/index.d.ts +1 -0
  209. package/lib/oidc/util/oauth.d.ts +1 -8
  210. package/lib/oidc/util/oauthMeta.d.ts +2 -0
  211. package/lib/oidc/util/prepareTokenParams.d.ts +3 -0
  212. package/lib/server/serverStorage.d.ts +1 -1
  213. package/lib/services/TokenService.d.ts +2 -2
  214. package/lib/tx/AuthTransaction.d.ts +2 -2
  215. package/lib/tx/TransactionState.d.ts +11 -1
  216. package/lib/tx/api.d.ts +6 -6
  217. package/lib/types/OktaAuthOptions.d.ts +5 -6
  218. package/lib/types/Storage.d.ts +3 -3
  219. package/lib/types/Transaction.d.ts +11 -0
  220. package/lib/types/UserClaims.d.ts +3 -3
  221. package/lib/types/api.d.ts +28 -16
  222. package/lib/util/console.d.ts +1 -1
  223. package/lib/util/index.d.ts +0 -1
  224. package/lib/util/types.d.ts +1 -1
  225. package/lib/util/url.d.ts +2 -2
  226. package/package.json +5 -5
  227. package/cjs/util/emailVerify.js +0 -28
  228. package/cjs/util/emailVerify.js.map +0 -1
@@ -8,6 +8,8 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
8
8
 
9
9
  var _Remediator = require("./Base/Remediator");
10
10
 
11
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
12
+
11
13
  /*!
12
14
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
15
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -28,7 +30,8 @@ class EnrollProfile extends _Remediator.Remediator {
28
30
  }
29
31
 
30
32
  canRemediate() {
31
- const userProfileFromValues = this.getData().userProfile;
33
+ const userProfileFromValues = this.getData().userProfile; // eslint-disable-next-line max-len
34
+
32
35
  const userProfileFromRemediation = this.remediation.value.find(({
33
36
  name
34
37
  }) => name === 'userProfile');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/EnrollProfile.ts"],"names":["EnrollProfile","Remediator","canRemediate","userProfileFromValues","getData","userProfile","userProfileFromRemediation","remediation","value","find","name","form","reduce","curr","required","mapUserProfile","profileAttributes","attributeNames","map","attributeValues","attributeName","values","getInputUserProfile","input","getErrorMessages","errorRemediation","errors","field","messages","push","message"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAWO,MAAMA,aAAN,SAA4BC,sBAA5B,CAAuC;AAAA;AAAA;AAAA,+CAKtC;AACJ,qBAAe;AADX,KALsC;AAAA;;AAS5CC,EAAAA,YAAY,GAAG;AACb,UAAMC,qBAAqB,GAAG,KAAKC,OAAL,GAAeC,WAA7C;AACA,UAAMC,0BAA0B,GAAG,KAAKC,WAAL,CAAiBC,KAAjB,CAAuBC,IAAvB,CAA4B,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,aAAnD,CAAnC;AACA,WAAOJ,0BAA0B,CAACK,IAA3B,CAAgCH,KAAhC,CAAsCI,MAAtC,CAA6C,CAACV,YAAD,EAAeW,IAAf,KAAwB;AAC1E,UAAIA,IAAI,CAACC,QAAT,EAAmB;AACjBZ,QAAAA,YAAY,GAAGA,YAAY,IAAI,CAAC,CAACC,qBAAqB,CAACU,IAAI,CAACH,IAAN,CAAtD;AACD;;AACD,aAAOR,YAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD;;AAEDa,EAAAA,cAAc,CAAC;AAACJ,IAAAA,IAAI,EAAE;AAAEH,MAAAA,KAAK,EAAEQ;AAAT;AAAP,GAAD,EAAuC;AACnD,UAAMC,cAAc,GAAGD,iBAAiB,CAACE,GAAlB,CAAsB,CAAC;AAACR,MAAAA;AAAD,KAAD,KAAYA,IAAlC,CAAvB;AACA,WAAOO,cAAc,CAACL,MAAf,CAAsB,CAACO,eAAD,EAAkBC,aAAlB,KAC3B,KAAKC,MAAL,CAAYD,aAAZ,IAA6B,EAC7B,GAAGD,eAD0B;AAE7B,OAACC,aAAD,GAAiB,KAAKC,MAAL,CAAYD,aAAZ;AAFY,KAA7B,GAGED,eAJG,EAIe,EAJf,CAAP;AAKD;;AAEDG,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,CAAC,GAAGA,KAAK,CAACZ,IAAN,CAAWH,KAAf,CAAP;AACD;;AAEDgB,EAAAA,gBAAgB,CAACC,gBAAD,EAAmB;AACjC,WAAOA,gBAAgB,CAACjB,KAAjB,CAAuB,CAAvB,EAA0BG,IAA1B,CAA+BH,KAA/B,CAAqCI,MAArC,CAA4C,CAACc,MAAD,EAASC,KAAT,KAAmB;AACpE,UAAIA,KAAK,CAACC,QAAV,EAAoB;AAClBF,QAAAA,MAAM,CAACG,IAAP,CAAYF,KAAK,CAACC,QAAN,CAAepB,KAAf,CAAqB,CAArB,EAAwBsB,OAApC;AACD;;AACD,aAAOJ,MAAP;AACD,KALM,EAKJ,EALI,CAAP;AAMD;;AAxC2C;;;8BAAjC1B,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\n\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 const userProfileFromRemediation = this.remediation.value.find(({ name }) => name === 'userProfile');\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","find","name","form","reduce","curr","required","mapUserProfile","profileAttributes","attributeNames","map","attributeValues","attributeName","values","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;AACb,UAAMC,qBAAqB,GAAG,KAAKC,OAAL,GAAeC,WAA7C,CADa,CAEb;;AACA,UAAMC,0BAA0B,GAAG,KAAKC,WAAL,CAAiBC,KAAjB,CAAwBC,IAAxB,CAA6B,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,aAApD,CAAnC;AACA,WAAOJ,0BAA0B,CAACK,IAA3B,CAAiCH,KAAjC,CAAuCI,MAAvC,CAA8C,CAACV,YAAD,EAAeW,IAAf,KAAwB;AAC3E,UAAIA,IAAI,CAACC,QAAT,EAAmB;AACjBZ,QAAAA,YAAY,GAAGA,YAAY,IAAI,CAAC,CAACC,qBAAqB,CAACU,IAAI,CAACH,IAAN,CAAtD;AACD;;AACD,aAAOR,YAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD;;AAEDa,EAAAA,cAAc,CAAC;AAACJ,IAAAA,IAAI,EAAE;AAAEH,MAAAA,KAAK,EAAEQ;AAAT;AAAP,GAAD,EAAuC;AACnD,UAAMC,cAAc,GAAGD,iBAAiB,CAACE,GAAlB,CAAsB,CAAC;AAACR,MAAAA;AAAD,KAAD,KAAYA,IAAlC,CAAvB;AACA,WAAOO,cAAc,CAACL,MAAf,CAAsB,CAACO,eAAD,EAAkBC,aAAlB,KAC3B,KAAKC,MAAL,CAAYD,aAAZ,IAA6B,EAC7B,GAAGD,eAD0B;AAE7B,OAACC,aAAD,GAAiB,KAAKC,MAAL,CAAYD,aAAZ;AAFY,KAA7B,GAGED,eAJG,EAIe,EAJf,CAAP;AAKD;;AAEDG,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,WAAO,CAAC,GAAGA,KAAK,CAACZ,IAAN,CAAWH,KAAf,CAAP;AACD;;AAEDgB,EAAAA,gBAAgB,CAACC,gBAAD,EAAmB;AACjC,WAAOA,gBAAgB,CAACjB,KAAjB,CAAuB,CAAvB,EAA0BG,IAA1B,CAA+BH,KAA/B,CAAqCI,MAArC,CAA4C,CAACc,MAAD,EAASC,KAAT,KAAmB;AACpE,UAAIA,KAAK,CAACC,QAAV,EAAoB;AAClBF,QAAAA,MAAM,CAACG,IAAP,CAAYF,KAAK,CAACC,QAAN,CAAepB,KAAf,CAAqB,CAArB,EAAwBsB,OAApC;AACD;;AACD,aAAOJ,MAAP;AACD,KALM,EAKJ,EALI,CAAP;AAMD;;AAzC2C;;;8BAAjC1B,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"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.EnrollmentChannelData = void 0;
6
+
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
+
9
+ var _Remediator = require("./Base/Remediator");
10
+
11
+ /*!
12
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
14
+ *
15
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ *
20
+ * See the License for the specific language governing permissions and limitations under the License.
21
+ */
22
+ class EnrollmentChannelData extends _Remediator.Remediator {
23
+ constructor(...args) {
24
+ super(...args);
25
+ (0, _defineProperty2.default)(this, "map", {
26
+ email: [],
27
+ phoneNumber: []
28
+ });
29
+ }
30
+
31
+ getInputEmail() {
32
+ return [{
33
+ name: 'email',
34
+ type: 'string',
35
+ required: true,
36
+ label: 'Email'
37
+ }];
38
+ }
39
+
40
+ getInputPhoneNumber() {
41
+ return [{
42
+ name: 'phoneNumber',
43
+ type: 'string',
44
+ required: true,
45
+ label: 'Phone Number'
46
+ }];
47
+ }
48
+
49
+ canRemediate() {
50
+ return Boolean(this.values.email || this.values.phoneNumber);
51
+ }
52
+
53
+ getNextStep(context) {
54
+ const common = super.getNextStep();
55
+ const authenticator = context.currentAuthenticator.value;
56
+ return { ...common,
57
+ authenticator
58
+ };
59
+ }
60
+
61
+ getData() {
62
+ return {
63
+ stateHandle: this.values.stateHandle,
64
+ email: this.values.email,
65
+ phoneNumber: this.values.phoneNumber
66
+ };
67
+ }
68
+
69
+ getValuesAfterProceed() {
70
+ let trimmedValues = Object.keys(this.values).filter(valueKey => !['email', 'phoneNumber'].includes(valueKey));
71
+ return trimmedValues.reduce((values, valueKey) => ({ ...values,
72
+ [valueKey]: this.values[valueKey]
73
+ }), {});
74
+ }
75
+
76
+ }
77
+
78
+ exports.EnrollmentChannelData = EnrollmentChannelData;
79
+ (0, _defineProperty2.default)(EnrollmentChannelData, "remediationName", 'enrollment-channel-data');
80
+ //# sourceMappingURL=EnrollmentChannelData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/EnrollmentChannelData.ts"],"names":["EnrollmentChannelData","Remediator","email","phoneNumber","getInputEmail","name","type","required","label","getInputPhoneNumber","canRemediate","Boolean","values","getNextStep","context","common","authenticator","currentAuthenticator","value","getData","stateHandle","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","includes","reduce"],"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,KAAKC,MAAL,CAAYV,KAAZ,IAAqB,KAAKU,MAAL,CAAYT,WAAlC,CAAd;AACD;;AAEDU,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,KAAKR,MAAL,CAAYQ,WADpB;AAELlB,MAAAA,KAAK,EAAE,KAAKU,MAAL,CAAYV,KAFd;AAGLC,MAAAA,WAAW,EAAE,KAAKS,MAAL,CAAYT;AAHpB,KAAP;AAKD;;AAEDkB,EAAAA,qBAAqB,GAAG;AACtB,QAAIC,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAY,KAAKZ,MAAjB,EAAyBa,MAAzB,CAAgCC,QAAQ,IAAI,CAAC,CAAC,OAAD,EAAU,aAAV,EAAyBC,QAAzB,CAAkCD,QAAlC,CAA7C,CAApB;AACA,WAAOJ,aAAa,CAACM,MAAd,CAAqB,CAAChB,MAAD,EAASc,QAAT,MAAuB,EAAC,GAAGd,MAAJ;AAAY,OAACc,QAAD,GAAY,KAAKd,MAAL,CAAYc,QAAZ;AAAxB,KAAvB,CAArB,EAA6F,EAA7F,CAAP;AACD;;AA9CmD;;;8BAAzC1B,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 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Identify.ts"],"names":["Identify","Remediator","canRemediate","identifier","getData","mapCredentials","passcode","values","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,KAAKC,MAAL,CAAYC;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;;;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 { 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","passcode","values","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,KAAKC,MAAL,CAAYC;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;;;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 { 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"}
@@ -34,6 +34,7 @@ class ReEnrollAuthenticator extends _Remediator.Remediator {
34
34
  }
35
35
 
36
36
  getInputCredentials(input) {
37
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
37
38
  const challengeType = this.getAuthenticator().type;
38
39
  const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';
39
40
  return { ...input.form.value[0],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ReEnrollAuthenticator.ts"],"names":["ReEnrollAuthenticator","Remediator","mapCredentials","passcode","values","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,KAAKC,MAAL,CAAYC;AADjB,KAAP;AAGD;;AAEDC,EAAAA,mBAAmB,CAACC,KAAD,EAAQ;AACzB,UAAMC,aAAa,GAAG,KAAKC,gBAAL,GAAwBC,IAA9C;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;;AAtBmD;;;8BAAzCX,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 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","passcode","values","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,KAAKC,MAAL,CAAYC;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;;;8BAAzCX,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 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/ResetAuthenticator.ts"],"names":["ResetAuthenticator","VerifyAuthenticator"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,MAAMA,kBAAN,SAAiCC,wCAAjC,CAAqD;;;8BAA/CD,kB,qBACc,qB","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 { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type ResetAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class ResetAuthenticator extends VerifyAuthenticator {\n static remediationName = 'reset-authenticator';\n values: ResetAuthenticatorValues;\n}\n"],"file":"ResetAuthenticator.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/ResetAuthenticator.ts"],"names":["ResetAuthenticator","VerifyAuthenticator"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,MAAMA,kBAAN,SAAiCC,wCAAjC,CAAqD;;;8BAA/CD,kB,qBACc,qB","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 { VerifyAuthenticator, VerifyAuthenticatorValues } from './Base/VerifyAuthenticator';\n\nexport type ResetAuthenticatorValues = VerifyAuthenticatorValues;\n\nexport class ResetAuthenticator extends VerifyAuthenticator {\n static remediationName = 'reset-authenticator';\n values!: ResetAuthenticatorValues;\n}\n"],"file":"ResetAuthenticator.js"}
@@ -31,10 +31,10 @@ class SelectAuthenticatorAuthenticate extends _SelectAuthenticator.SelectAuthent
31
31
 
32
32
  const hasPasswordInOptions = (_getAuthenticatorFrom = (0, _util.getAuthenticatorFromRemediation)(remediation).options) === null || _getAuthenticatorFrom === void 0 ? void 0 : _getAuthenticatorFrom.some(({
33
33
  relatesTo
34
- }) => relatesTo.key === _types.AuthenticatorKey.OKTA_PASSWORD);
34
+ }) => (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.key) === _types.AuthenticatorKey.OKTA_PASSWORD);
35
35
 
36
36
  if (hasPasswordInOptions && (this.values.flow === 'recoverPassword' || this.values.password)) {
37
- this.values.authenticators = [...this.values.authenticators, {
37
+ this.values.authenticators = [...(this.values.authenticators || []), {
38
38
  key: _types.AuthenticatorKey.OKTA_PASSWORD
39
39
  }];
40
40
  }
@@ -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,KAAmBA,SAAS,CAACC,GAAV,KAAkBC,wBAAiBC,aAD1C,CAA7B;;AAEA,QAAIN,oBAAoB,KAAK,KAAKD,MAAL,CAAYQ,IAAZ,KAAqB,iBAArB,IAA0C,KAAKR,MAAL,CAAYS,QAA3D,CAAxB,EAA8F;AAC5F,WAAKT,MAAL,CAAYU,cAAZ,GAA6B,CAC3B,GAAG,KAAKV,MAAL,CAAYU,cADY,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","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,KAAKD,MAAL,CAAYQ,IAAZ,KAAqB,iBAArB,IAA0C,KAAKR,MAAL,CAAYS,QAA3D,CAAxB,EAA8F;AAC5F,WAAKT,MAAL,CAAYU,cAAZ,GAA6B,CAC3B,IAAG,KAAKV,MAAL,CAAYU,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 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorEnroll.ts"],"names":["SelectAuthenticatorEnroll","SelectAuthenticator"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,MAAMA,yBAAN,SAAwCC,wCAAxC,CAA4D;;;8BAAtDD,yB,qBACc,6B","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';\n\nexport type SelectAuthenticatorEnrollValues = SelectAuthenticatorValues;\n\nexport class SelectAuthenticatorEnroll extends SelectAuthenticator {\n static remediationName = 'select-authenticator-enroll';\n values: SelectAuthenticatorEnrollValues;\n}\n"],"file":"SelectAuthenticatorEnroll.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/SelectAuthenticatorEnroll.ts"],"names":["SelectAuthenticatorEnroll","SelectAuthenticator"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOO,MAAMA,yBAAN,SAAwCC,wCAAxC,CAA4D;;;8BAAtDD,yB,qBACc,6B","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';\n\nexport type SelectAuthenticatorEnrollValues = SelectAuthenticatorValues;\n\nexport class SelectAuthenticatorEnroll extends SelectAuthenticator {\n static remediationName = 'select-authenticator-enroll';\n values!: SelectAuthenticatorEnrollValues;\n}\n"],"file":"SelectAuthenticatorEnroll.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/SelectEnrollProfile.ts"],"names":["SelectEnrollProfile","Remediator","canRemediate"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAMA,mBAAN,SAAkCC,sBAAlC,CAA6C;AAKlDC,EAAAA,YAAY,GAAG;AACb,WAAO,IAAP;AACD;;AAPiD;;;8BAAvCF,mB,qBACc,uB","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\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SelectEnrollProfileValues extends RemediationValues {}\n\nexport class SelectEnrollProfile extends Remediator {\n static remediationName = 'select-enroll-profile';\n\n values: SelectEnrollProfileValues;\n\n canRemediate() {\n return true;\n }\n}\n"],"file":"SelectEnrollProfile.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/SelectEnrollProfile.ts"],"names":["SelectEnrollProfile","Remediator","canRemediate"],"mappings":";;;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAMA,mBAAN,SAAkCC,sBAAlC,CAA6C;AAKlDC,EAAAA,YAAY,GAAG;AACb,WAAO,IAAP;AACD;;AAPiD;;;8BAAvCF,mB,qBACc,uB","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\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SelectEnrollProfileValues extends RemediationValues {}\n\nexport class SelectEnrollProfile extends Remediator {\n static remediationName = 'select-enroll-profile';\n\n values!: SelectEnrollProfileValues;\n\n canRemediate() {\n return true;\n }\n}\n"],"file":"SelectEnrollProfile.js"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ exports.SelectEnrollmentChannel = void 0;
6
+
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
+
9
+ var _Remediator = require("./Base/Remediator");
10
+
11
+ var _util = require("./util");
12
+
13
+ /*!
14
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
15
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
16
+ *
17
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ *
22
+ * See the License for the specific language governing permissions and limitations under the License.
23
+ */
24
+ class SelectEnrollmentChannel extends _Remediator.Remediator {
25
+ canRemediate() {
26
+ return Boolean(this.values.channel);
27
+ }
28
+
29
+ getNextStep(context) {
30
+ const common = super.getNextStep();
31
+ const options = this.getChannels();
32
+ const authenticator = context.currentAuthenticator.value;
33
+ return { ...common,
34
+ ...(options && {
35
+ options
36
+ }),
37
+ authenticator
38
+ };
39
+ }
40
+
41
+ getChannels() {
42
+ var _remediationValue$for;
43
+
44
+ const authenticator = (0, _util.getAuthenticatorFromRemediation)(this.remediation);
45
+ const remediationValue = authenticator.value;
46
+ return (_remediationValue$for = remediationValue.form.value.find(({
47
+ name
48
+ }) => name === 'channel')) === null || _remediationValue$for === void 0 ? void 0 : _remediationValue$for.options;
49
+ }
50
+
51
+ getData() {
52
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
53
+ const remediationValue = this.remediation.value[0].value;
54
+ return {
55
+ authenticator: {
56
+ id: remediationValue.form.value[0].value,
57
+ channel: this.values.channel
58
+ },
59
+ stateHandle: this.values.stateHandle
60
+ };
61
+ }
62
+
63
+ getValuesAfterProceed() {
64
+ let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'channel');
65
+ return trimmedValues.reduce((values, valueKey) => ({ ...values,
66
+ [valueKey]: this.values[valueKey]
67
+ }), {});
68
+ }
69
+
70
+ }
71
+
72
+ exports.SelectEnrollmentChannel = SelectEnrollmentChannel;
73
+ (0, _defineProperty2.default)(SelectEnrollmentChannel, "remediationName", 'select-enrollment-channel');
74
+ //# sourceMappingURL=SelectEnrollmentChannel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/SelectEnrollmentChannel.ts"],"names":["SelectEnrollmentChannel","Remediator","canRemediate","Boolean","values","channel","getNextStep","context","common","options","getChannels","authenticator","currentAuthenticator","value","remediation","remediationValue","form","find","name","getData","id","stateHandle","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"mappings":";;;;;;;;AAaA;;AAEA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAaO,MAAMA,uBAAN,SAAsCC,sBAAtC,CAAiD;AAKtDC,EAAAA,YAAY,GAAG;AACb,WAAOC,OAAO,CAAC,KAAKC,MAAL,CAAYC,OAAb,CAAd;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAsB;AAC/B,UAAMC,MAAM,GAAG,MAAMF,WAAN,EAAf;AACA,UAAMG,OAAO,GAAG,KAAKC,WAAL,EAAhB;AACA,UAAMC,aAAa,GAAGJ,OAAO,CAACK,oBAAR,CAA6BC,KAAnD;AACA,WAAO,EACL,GAAGL,MADE;AAEL,UAAIC,OAAO,IAAI;AAAEA,QAAAA;AAAF,OAAf,CAFK;AAGLE,MAAAA;AAHK,KAAP;AAKD;;AAEOD,EAAAA,WAAW,GAA4B;AAAA;;AAC7C,UAAMC,aAAkC,GAAG,2CAAgC,KAAKG,WAArC,CAA3C;AACA,UAAMC,gBAAgB,GAAGJ,aAAa,CAACE,KAAvC;AACA,oCAAOE,gBAAgB,CAACC,IAAjB,CAAsBH,KAAtB,CAA4BI,IAA5B,CAAiC,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,SAAxD,CAAP,0DAAO,sBAAoET,OAA3E;AACD;;AAEDU,EAAAA,OAAO,GAAG;AACR;AACA,UAAMJ,gBAAgB,GAAG,KAAKD,WAAL,CAAkBD,KAAlB,CAAyB,CAAzB,EAA4BA,KAArD;AACA,WAAO;AACLF,MAAAA,aAAa,EAAE;AACbS,QAAAA,EAAE,EAAEL,gBAAgB,CAACC,IAAjB,CAAsBH,KAAtB,CAA4B,CAA5B,EAA+BA,KADtB;AAEbR,QAAAA,OAAO,EAAE,KAAKD,MAAL,CAAYC;AAFR,OADV;AAKLgB,MAAAA,WAAW,EAAE,KAAKjB,MAAL,CAAYiB;AALpB,KAAP;AAQD;;AAEDC,EAAAA,qBAAqB,GAAG;AACtB,QAAIC,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAY,KAAKrB,MAAjB,EAAyBsB,MAAzB,CAAgCC,QAAQ,IAAIA,QAAQ,KAAK,SAAzD,CAApB;AACA,WAAOJ,aAAa,CAACK,MAAd,CAAqB,CAACxB,MAAD,EAASuB,QAAT,MAAuB,EAAC,GAAGvB,MAAJ;AAAY,OAACuB,QAAD,GAAY,KAAKvB,MAAL,CAAYuB,QAAZ;AAAxB,KAAvB,CAArB,EAA6F,EAA7F,CAAP;AACD;;AA1CqD;;;8BAA3C3B,uB,qBACc,2B","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 { IdxRemediationValueForm, IdxOption, IdxRemediationValue, IdxContext } from '../types/idx-js';\nimport { getAuthenticatorFromRemediation } from './util';\n\n\n\nexport type SelectEnrollmentChannelValues = RemediationValues & {\n channel?: string;\n};\n\nexport class SelectEnrollmentChannel extends Remediator {\n static remediationName = 'select-enrollment-channel';\n\n values!: SelectEnrollmentChannelValues;\n\n canRemediate() {\n return Boolean(this.values.channel);\n }\n\n getNextStep(context: IdxContext) {\n const common = super.getNextStep();\n const options = this.getChannels();\n const authenticator = context.currentAuthenticator.value;\n return {\n ...common,\n ...(options && { options }),\n authenticator,\n };\n }\n\n private getChannels(): IdxOption[] | undefined {\n const authenticator: IdxRemediationValue = getAuthenticatorFromRemediation(this.remediation);\n const remediationValue = authenticator.value as IdxRemediationValueForm;\n return remediationValue.form.value.find(({ name }) => name === 'channel')?.options;\n }\n\n getData() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const remediationValue = this.remediation!.value![0].value as IdxRemediationValueForm;\n return {\n authenticator: {\n id: remediationValue.form.value[0].value,\n channel: this.values.channel,\n },\n stateHandle: this.values.stateHandle,\n\n };\n }\n\n getValuesAfterProceed() {\n let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'channel');\n return trimmedValues.reduce((values, valueKey) => ({...values, [valueKey]: this.values[valueKey]}), {});\n }\n}\n"],"file":"SelectEnrollmentChannel.js"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/Skip.ts"],"names":["Skip","Remediator","skip","canRemediate","values"],"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,KAAKC,MAAL,CAAYF,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","skip","canRemediate","values"],"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,KAAKC,MAAL,CAAYF,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"}
@@ -39,6 +39,32 @@ Object.keys(_EnrollPoll).forEach(function (key) {
39
39
  });
40
40
  });
41
41
 
42
+ var _SelectEnrollmentChannel = require("./SelectEnrollmentChannel");
43
+
44
+ Object.keys(_SelectEnrollmentChannel).forEach(function (key) {
45
+ if (key === "default" || key === "__esModule") return;
46
+ if (key in exports && exports[key] === _SelectEnrollmentChannel[key]) return;
47
+ Object.defineProperty(exports, key, {
48
+ enumerable: true,
49
+ get: function () {
50
+ return _SelectEnrollmentChannel[key];
51
+ }
52
+ });
53
+ });
54
+
55
+ var _EnrollmentChannelData = require("./EnrollmentChannelData");
56
+
57
+ Object.keys(_EnrollmentChannelData).forEach(function (key) {
58
+ if (key === "default" || key === "__esModule") return;
59
+ if (key in exports && exports[key] === _EnrollmentChannelData[key]) return;
60
+ Object.defineProperty(exports, key, {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _EnrollmentChannelData[key];
64
+ }
65
+ });
66
+ });
67
+
42
68
  var _ChallengeAuthenticator = require("./ChallengeAuthenticator");
43
69
 
44
70
  Object.keys(_ChallengeAuthenticator).forEach(function (key) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/index.ts"],"names":[],"mappings":";;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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\nexport * from './Base/Remediator';\nexport * from './EnrollAuthenticator';\nexport * from './EnrollPoll';\nexport * from './ChallengeAuthenticator';\nexport * from './ChallengePoll';\nexport * from './ResetAuthenticator';\nexport * from './EnrollProfile';\nexport * from './Identify';\nexport * from './ReEnrollAuthenticator';\nexport * from './RedirectIdp';\nexport * from './SelectAuthenticatorAuthenticate';\nexport * from './SelectAuthenticatorEnroll';\nexport * from './SelectEnrollProfile';\nexport * from './AuthenticatorVerificationData';\nexport * from './AuthenticatorEnrollmentData';\nexport * from './Skip';\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/index.ts"],"names":[],"mappings":";;AAaA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","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\nexport * from './Base/Remediator';\nexport * from './EnrollAuthenticator';\nexport * from './EnrollPoll';\nexport * from './SelectEnrollmentChannel';\nexport * from './EnrollmentChannelData';\nexport * from './ChallengeAuthenticator';\nexport * from './ChallengePoll';\nexport * from './ResetAuthenticator';\nexport * from './EnrollProfile';\nexport * from './Identify';\nexport * from './ReEnrollAuthenticator';\nexport * from './RedirectIdp';\nexport * from './SelectAuthenticatorAuthenticate';\nexport * from './SelectAuthenticatorEnroll';\nexport * from './SelectEnrollProfile';\nexport * from './AuthenticatorVerificationData';\nexport * from './AuthenticatorEnrollmentData';\nexport * from './Skip';\n"],"file":"index.js"}
@@ -17,11 +17,15 @@ exports.getAuthenticatorFromRemediation = getAuthenticatorFromRemediation;
17
17
  * See the License for the specific language governing permissions and limitations under the License.
18
18
  */
19
19
  function getAllValues(idxRemediation) {
20
- return idxRemediation.value.map(r => r.name);
20
+ var _idxRemediation$value;
21
+
22
+ return (_idxRemediation$value = idxRemediation.value) === null || _idxRemediation$value === void 0 ? void 0 : _idxRemediation$value.map(r => r.name);
21
23
  }
22
24
 
23
25
  function getRequiredValues(idxRemediation) {
24
- return idxRemediation.value.reduce((required, cur) => {
26
+ var _idxRemediation$value2;
27
+
28
+ return (_idxRemediation$value2 = idxRemediation.value) === null || _idxRemediation$value2 === void 0 ? void 0 : _idxRemediation$value2.reduce((required, cur) => {
25
29
  if (cur.required) {
26
30
  required.push(cur.name);
27
31
  }
@@ -35,6 +39,7 @@ function titleCase(str) {
35
39
  }
36
40
 
37
41
  function getAuthenticatorFromRemediation(remediation) {
42
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
43
  return remediation.value.find(({
39
44
  name
40
45
  }) => name === 'authenticator');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/util.ts"],"names":["getAllValues","idxRemediation","value","map","r","name","getRequiredValues","reduce","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation","find"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,SAASA,YAAT,CAAsBC,cAAtB,EAAsD;AAC3D,SAAOA,cAAc,CAACC,KAAf,CAAqBC,GAArB,CAAyBC,CAAC,IAAIA,CAAC,CAACC,IAAhC,CAAP;AACD;;AAEM,SAASC,iBAAT,CAA2BL,cAA3B,EAA2D;AAChE,SAAOA,cAAc,CAACC,KAAf,CAAqBK,MAArB,CAA4B,CAACC,QAAD,EAAWC,GAAX,KAAmB;AACpD,QAAIA,GAAG,CAACD,QAAR,EAAkB;AAChBA,MAAAA,QAAQ,CAACE,IAAT,CAAcD,GAAG,CAACJ,IAAlB;AACD;;AACD,WAAOG,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;AACrB,SAAOA,WAAW,CAACf,KAAZ,CAAkBgB,IAAlB,CAAuB,CAAC;AAAEb,IAAAA;AAAF,GAAD,KAAcA,IAAI,KAAK,eAA9C,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);\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 return remediation.value.find(({ name }) => name === 'authenticator');\n}\n"],"file":"util.js"}
1
+ {"version":3,"sources":["../../../../lib/idx/remediators/util.ts"],"names":["getAllValues","idxRemediation","value","map","r","name","getRequiredValues","reduce","required","cur","push","titleCase","str","charAt","toUpperCase","substring","getAuthenticatorFromRemediation","remediation","find"],"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,sBAAsBC,GAAtB,CAA0BC,CAAC,IAAIA,CAAC,CAACC,IAAjC,CAAP;AACD;;AAEM,SAASC,iBAAT,CAA2BL,cAA3B,EAA2D;AAAA;;AAChE,mCAAOA,cAAc,CAACC,KAAtB,2DAAO,uBAAsBK,MAAtB,CAA6B,CAACC,QAAD,EAAWC,GAAX,KAAmB;AACrD,QAAIA,GAAG,CAACD,QAAR,EAAkB;AAChBA,MAAAA,QAAQ,CAACE,IAAT,CAAcD,GAAG,CAACJ,IAAlB;AACD;;AACD,WAAOG,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;AACrB;AACA,SAAOA,WAAW,CAACf,KAAZ,CAAmBgB,IAAnB,CAAwB,CAAC;AAAEb,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"}