@okta/okta-auth-js 5.10.0 → 6.1.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 (396) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +10 -6
  3. package/cjs/AuthStateManager.js +11 -3
  4. package/cjs/AuthStateManager.js.map +1 -1
  5. package/cjs/OktaAuth.js +139 -95
  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 +11 -2
  10. package/cjs/PromiseQueue.js.map +1 -1
  11. package/cjs/SavedObject.js +4 -2
  12. package/cjs/SavedObject.js.map +1 -1
  13. package/cjs/StorageManager.js +16 -9
  14. package/cjs/StorageManager.js.map +1 -1
  15. package/cjs/TokenManager.js +38 -22
  16. package/cjs/TokenManager.js.map +1 -1
  17. package/cjs/TransactionManager.js +26 -7
  18. package/cjs/TransactionManager.js.map +1 -1
  19. package/cjs/browser/browserStorage.js +25 -14
  20. package/cjs/browser/browserStorage.js.map +1 -1
  21. package/cjs/browser/fingerprint.js +12 -4
  22. package/cjs/browser/fingerprint.js.map +1 -1
  23. package/cjs/builderUtil.js +7 -19
  24. package/cjs/builderUtil.js.map +1 -1
  25. package/cjs/clock.js +5 -1
  26. package/cjs/clock.js.map +1 -1
  27. package/cjs/crypto/base64.js +18 -0
  28. package/cjs/crypto/base64.js.map +1 -1
  29. package/cjs/crypto/index.js +6 -4
  30. package/cjs/crypto/index.js.map +1 -1
  31. package/cjs/crypto/oidcHash.js +5 -1
  32. package/cjs/crypto/oidcHash.js.map +1 -1
  33. package/cjs/crypto/webauthn.js +101 -0
  34. package/cjs/crypto/webauthn.js.map +1 -0
  35. package/cjs/crypto/webcrypto.js +3 -1
  36. package/cjs/crypto/webcrypto.js.map +1 -1
  37. package/cjs/errors/AuthApiError.js +1 -1
  38. package/cjs/errors/AuthPollStopError.js +1 -1
  39. package/cjs/errors/AuthSdkError.js +1 -1
  40. package/cjs/errors/CustomError.js +5 -1
  41. package/cjs/errors/CustomError.js.map +1 -1
  42. package/cjs/errors/OAuthError.js +1 -1
  43. package/cjs/errors/index.js +1 -1
  44. package/cjs/features.js +9 -3
  45. package/cjs/features.js.map +1 -1
  46. package/cjs/fetch/fetchRequest.js +19 -6
  47. package/cjs/fetch/fetchRequest.js.map +1 -1
  48. package/cjs/http/headers.js.map +1 -1
  49. package/cjs/http/index.js +4 -2
  50. package/cjs/http/index.js.map +1 -1
  51. package/cjs/http/request.js +11 -5
  52. package/cjs/http/request.js.map +1 -1
  53. package/cjs/idx/authenticate.js +8 -5
  54. package/cjs/idx/authenticate.js.map +1 -1
  55. package/cjs/idx/authenticator/Authenticator.js.map +1 -1
  56. package/cjs/idx/authenticator/OktaPassword.js.map +1 -1
  57. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +1 -1
  58. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -1
  59. package/cjs/idx/authenticator/SecurityQuestionVerification.js +2 -1
  60. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -1
  61. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +2 -2
  62. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -1
  63. package/cjs/idx/authenticator/WebauthnEnrollment.js +46 -0
  64. package/cjs/idx/authenticator/WebauthnEnrollment.js.map +1 -0
  65. package/cjs/idx/authenticator/WebauthnVerification.js +55 -0
  66. package/cjs/idx/authenticator/WebauthnVerification.js.map +1 -0
  67. package/cjs/idx/authenticator/getAuthenticator.js +17 -6
  68. package/cjs/idx/authenticator/getAuthenticator.js.map +1 -1
  69. package/cjs/idx/authenticator/index.js +34 -6
  70. package/cjs/idx/authenticator/index.js.map +1 -1
  71. package/cjs/idx/cancel.js.map +1 -1
  72. package/cjs/idx/emailVerify.js +73 -0
  73. package/cjs/idx/emailVerify.js.map +1 -0
  74. package/cjs/idx/flow/AccountUnlockFlow.js +30 -0
  75. package/cjs/idx/flow/AccountUnlockFlow.js.map +1 -0
  76. package/cjs/idx/flow/AuthenticationFlow.js +2 -1
  77. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
  78. package/cjs/idx/flow/FlowSpecification.js +24 -4
  79. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  80. package/cjs/idx/flow/PasswordRecoveryFlow.js +4 -1
  81. package/cjs/idx/flow/PasswordRecoveryFlow.js.map +1 -1
  82. package/cjs/idx/flow/RegistrationFlow.js +2 -0
  83. package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
  84. package/cjs/idx/flow/index.js +20 -5
  85. package/cjs/idx/flow/index.js.map +1 -1
  86. package/cjs/idx/handleInteractionCodeRedirect.js +6 -1
  87. package/cjs/idx/handleInteractionCodeRedirect.js.map +1 -1
  88. package/cjs/idx/headers.js +21 -5
  89. package/cjs/idx/headers.js.map +1 -1
  90. package/cjs/idx/idx-js/client.js +91 -0
  91. package/cjs/idx/idx-js/client.js.map +1 -0
  92. package/cjs/idx/idx-js/index.js +162 -0
  93. package/cjs/idx/idx-js/index.js.map +1 -0
  94. package/cjs/idx/idx-js/interact.js +83 -0
  95. package/cjs/idx/idx-js/interact.js.map +1 -0
  96. package/cjs/idx/idx-js/introspect.js +58 -0
  97. package/cjs/idx/idx-js/introspect.js.map +1 -0
  98. package/cjs/idx/idx-js/parsers.js +41 -0
  99. package/cjs/idx/idx-js/parsers.js.map +1 -0
  100. package/cjs/idx/idx-js/util.js +34 -0
  101. package/cjs/idx/idx-js/util.js.map +1 -0
  102. package/cjs/idx/idx-js/v1/actionParser.js +90 -0
  103. package/cjs/idx/idx-js/v1/actionParser.js.map +1 -0
  104. package/cjs/idx/idx-js/v1/generateIdxAction.js +117 -0
  105. package/cjs/idx/idx-js/v1/generateIdxAction.js.map +1 -0
  106. package/cjs/idx/idx-js/v1/idxResponseParser.js +137 -0
  107. package/cjs/idx/idx-js/v1/idxResponseParser.js.map +1 -0
  108. package/cjs/idx/idx-js/v1/makeIdxState.js +64 -0
  109. package/cjs/idx/idx-js/v1/makeIdxState.js.map +1 -0
  110. package/cjs/idx/idx-js/v1/parsers.js +24 -0
  111. package/cjs/idx/idx-js/v1/parsers.js.map +1 -0
  112. package/cjs/idx/idx-js/v1/remediationParser.js +32 -0
  113. package/cjs/idx/idx-js/v1/remediationParser.js.map +1 -0
  114. package/cjs/idx/index.js +121 -109
  115. package/cjs/idx/index.js.map +1 -1
  116. package/cjs/idx/interact.js +53 -36
  117. package/cjs/idx/interact.js.map +1 -1
  118. package/cjs/idx/introspect.js +17 -19
  119. package/cjs/idx/introspect.js.map +1 -1
  120. package/cjs/idx/poll.js +13 -3
  121. package/cjs/idx/poll.js.map +1 -1
  122. package/cjs/idx/proceed.js +4 -7
  123. package/cjs/idx/proceed.js.map +1 -1
  124. package/cjs/idx/recoverPassword.js +1 -1
  125. package/cjs/idx/recoverPassword.js.map +1 -1
  126. package/cjs/idx/register.js +11 -16
  127. package/cjs/idx/register.js.map +1 -1
  128. package/cjs/idx/remediate.js +74 -27
  129. package/cjs/idx/remediate.js.map +1 -1
  130. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +12 -4
  131. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  132. package/cjs/idx/remediators/AuthenticatorVerificationData.js +13 -7
  133. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  134. package/cjs/idx/remediators/Base/AuthenticatorData.js +31 -13
  135. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  136. package/cjs/idx/remediators/Base/Remediator.js +67 -31
  137. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  138. package/cjs/idx/remediators/Base/SelectAuthenticator.js +46 -30
  139. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  140. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +16 -4
  141. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  142. package/cjs/idx/remediators/ChallengeAuthenticator.js +2 -2
  143. package/cjs/idx/remediators/ChallengeAuthenticator.js.map +1 -1
  144. package/cjs/idx/remediators/ChallengePoll.js +2 -2
  145. package/cjs/idx/remediators/EnrollAuthenticator.js +2 -2
  146. package/cjs/idx/remediators/EnrollAuthenticator.js.map +1 -1
  147. package/cjs/idx/remediators/EnrollPoll.js +18 -9
  148. package/cjs/idx/remediators/EnrollPoll.js.map +1 -1
  149. package/cjs/idx/remediators/EnrollProfile.js +24 -9
  150. package/cjs/idx/remediators/EnrollProfile.js.map +1 -1
  151. package/cjs/idx/remediators/EnrollmentChannelData.js +96 -0
  152. package/cjs/idx/remediators/EnrollmentChannelData.js.map +1 -0
  153. package/cjs/idx/remediators/Identify.js +5 -3
  154. package/cjs/idx/remediators/Identify.js.map +1 -1
  155. package/cjs/idx/remediators/ReEnrollAuthenticator.js +6 -3
  156. package/cjs/idx/remediators/ReEnrollAuthenticator.js.map +1 -1
  157. package/cjs/idx/remediators/RedirectIdp.js +2 -2
  158. package/cjs/idx/remediators/ResetAuthenticator.js +2 -2
  159. package/cjs/idx/remediators/ResetAuthenticator.js.map +1 -1
  160. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +7 -5
  161. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  162. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js +2 -2
  163. package/cjs/idx/remediators/SelectAuthenticatorEnroll.js.map +1 -1
  164. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js +72 -0
  165. package/cjs/idx/remediators/SelectAuthenticatorUnlockAccount.js.map +1 -0
  166. package/cjs/idx/remediators/SelectEnrollProfile.js +2 -2
  167. package/cjs/idx/remediators/SelectEnrollProfile.js.map +1 -1
  168. package/cjs/idx/remediators/SelectEnrollmentChannel.js +86 -0
  169. package/cjs/idx/remediators/SelectEnrollmentChannel.js.map +1 -0
  170. package/cjs/idx/remediators/Skip.js +5 -3
  171. package/cjs/idx/remediators/Skip.js.map +1 -1
  172. package/cjs/idx/remediators/index.js +57 -16
  173. package/cjs/idx/remediators/index.js.map +1 -1
  174. package/cjs/idx/remediators/util.js +18 -3
  175. package/cjs/idx/remediators/util.js.map +1 -1
  176. package/cjs/idx/run.js +139 -49
  177. package/cjs/idx/run.js.map +1 -1
  178. package/cjs/idx/startTransaction.js +4 -2
  179. package/cjs/idx/startTransaction.js.map +1 -1
  180. package/cjs/idx/transactionMeta.js +82 -69
  181. package/cjs/idx/transactionMeta.js.map +1 -1
  182. package/cjs/idx/types/idx-js.js.map +1 -1
  183. package/cjs/idx/types/index.js +59 -7
  184. package/cjs/idx/types/index.js.map +1 -1
  185. package/cjs/idx/unlockAccount.js +48 -0
  186. package/cjs/idx/unlockAccount.js.map +1 -0
  187. package/cjs/index.js +33 -13
  188. package/cjs/index.js.map +1 -1
  189. package/cjs/oidc/endpoints/authorize.js +10 -2
  190. package/cjs/oidc/endpoints/authorize.js.map +1 -1
  191. package/cjs/oidc/endpoints/index.js +5 -3
  192. package/cjs/oidc/endpoints/index.js.map +1 -1
  193. package/cjs/oidc/endpoints/token.js +16 -3
  194. package/cjs/oidc/endpoints/token.js.map +1 -1
  195. package/cjs/oidc/endpoints/well-known.js +7 -3
  196. package/cjs/oidc/endpoints/well-known.js.map +1 -1
  197. package/cjs/oidc/exchangeCodeForTokens.js +12 -4
  198. package/cjs/oidc/exchangeCodeForTokens.js.map +1 -1
  199. package/cjs/oidc/getToken.js +12 -6
  200. package/cjs/oidc/getToken.js.map +1 -1
  201. package/cjs/oidc/getUserInfo.js +7 -3
  202. package/cjs/oidc/getUserInfo.js.map +1 -1
  203. package/cjs/oidc/getWithPopup.js +8 -2
  204. package/cjs/oidc/getWithPopup.js.map +1 -1
  205. package/cjs/oidc/getWithRedirect.js +15 -38
  206. package/cjs/oidc/getWithRedirect.js.map +1 -1
  207. package/cjs/oidc/getWithoutPrompt.js +8 -2
  208. package/cjs/oidc/getWithoutPrompt.js.map +1 -1
  209. package/cjs/oidc/handleOAuthResponse.js +87 -87
  210. package/cjs/oidc/handleOAuthResponse.js.map +1 -1
  211. package/cjs/oidc/index.js +4 -2
  212. package/cjs/oidc/index.js.map +1 -1
  213. package/cjs/oidc/parseFromUrl.js +9 -3
  214. package/cjs/oidc/parseFromUrl.js.map +1 -1
  215. package/cjs/oidc/renewToken.js.map +1 -1
  216. package/cjs/oidc/renewTokens.js +6 -2
  217. package/cjs/oidc/renewTokens.js.map +1 -1
  218. package/cjs/oidc/renewTokensWithRefresh.js +5 -1
  219. package/cjs/oidc/renewTokensWithRefresh.js.map +1 -1
  220. package/cjs/oidc/revokeToken.js +34 -31
  221. package/cjs/oidc/revokeToken.js.map +1 -1
  222. package/cjs/oidc/util/browser.js +5 -1
  223. package/cjs/oidc/util/browser.js.map +1 -1
  224. package/cjs/oidc/util/defaultTokenParams.js.map +1 -1
  225. package/cjs/oidc/util/errors.js.map +1 -1
  226. package/cjs/oidc/util/index.js +27 -11
  227. package/cjs/oidc/util/index.js.map +1 -1
  228. package/cjs/oidc/util/loginRedirect.js +10 -1
  229. package/cjs/oidc/util/loginRedirect.js.map +1 -1
  230. package/cjs/oidc/util/oauth.js +4 -2
  231. package/cjs/oidc/util/oauth.js.map +1 -1
  232. package/cjs/oidc/util/oauthMeta.js +36 -0
  233. package/cjs/oidc/util/oauthMeta.js.map +1 -0
  234. package/cjs/oidc/util/pkce.js +11 -3
  235. package/cjs/oidc/util/pkce.js.map +1 -1
  236. package/cjs/oidc/util/prepareTokenParams.js +62 -39
  237. package/cjs/oidc/util/prepareTokenParams.js.map +1 -1
  238. package/cjs/oidc/util/validateClaims.js +3 -1
  239. package/cjs/oidc/util/validateClaims.js.map +1 -1
  240. package/cjs/oidc/verifyToken.js +13 -4
  241. package/cjs/oidc/verifyToken.js.map +1 -1
  242. package/cjs/options.js +12 -6
  243. package/cjs/options.js.map +1 -1
  244. package/cjs/server/serverStorage.js +2 -1
  245. package/cjs/server/serverStorage.js.map +1 -1
  246. package/cjs/services/TokenService.js +3 -0
  247. package/cjs/services/TokenService.js.map +1 -1
  248. package/cjs/tx/AuthTransaction.js +18 -9
  249. package/cjs/tx/AuthTransaction.js.map +1 -1
  250. package/cjs/tx/TransactionState.js +0 -17
  251. package/cjs/tx/TransactionState.js.map +1 -1
  252. package/cjs/tx/api.js +11 -6
  253. package/cjs/tx/api.js.map +1 -1
  254. package/cjs/tx/index.js +7 -5
  255. package/cjs/tx/index.js.map +1 -1
  256. package/cjs/tx/poll.js +6 -4
  257. package/cjs/tx/poll.js.map +1 -1
  258. package/cjs/tx/util.js +5 -1
  259. package/cjs/tx/util.js.map +1 -1
  260. package/cjs/types/Transaction.js +10 -2
  261. package/cjs/types/Transaction.js.map +1 -1
  262. package/cjs/types/index.js +16 -14
  263. package/cjs/types/index.js.map +1 -1
  264. package/cjs/util/index.js +7 -18
  265. package/cjs/util/index.js.map +1 -1
  266. package/cjs/util/misc.js +5 -1
  267. package/cjs/util/misc.js.map +1 -1
  268. package/cjs/util/object.js +16 -6
  269. package/cjs/util/object.js.map +1 -1
  270. package/cjs/util/sharedStorage.js +5 -1
  271. package/cjs/util/sharedStorage.js.map +1 -1
  272. package/cjs/util/url.js.map +1 -1
  273. package/dist/okta-auth-js.min.js +1 -1
  274. package/dist/okta-auth-js.min.js.LICENSE.txt +0 -12
  275. package/dist/okta-auth-js.min.js.map +1 -1
  276. package/dist/okta-auth-js.polyfill.js +1 -1
  277. package/dist/okta-auth-js.polyfill.js.map +1 -1
  278. package/dist/okta-auth-js.umd.js +1 -1
  279. package/dist/okta-auth-js.umd.js.LICENSE.txt +0 -12
  280. package/dist/okta-auth-js.umd.js.map +1 -1
  281. package/esm/index.js +2758 -957
  282. package/esm/index.js.map +1 -1
  283. package/lib/AuthStateManager.d.ts +1 -2
  284. package/lib/OktaAuth.d.ts +10 -13
  285. package/lib/StorageManager.d.ts +2 -2
  286. package/lib/TokenManager.d.ts +4 -4
  287. package/lib/TransactionManager.d.ts +4 -3
  288. package/lib/browser/fingerprint.d.ts +2 -3
  289. package/lib/builderUtil.d.ts +1 -2
  290. package/lib/crypto/base64.d.ts +2 -0
  291. package/lib/crypto/browser.d.ts +1 -1
  292. package/lib/crypto/webauthn.d.ts +25 -0
  293. package/lib/features.d.ts +1 -1
  294. package/lib/http/headers.d.ts +2 -2
  295. package/lib/http/request.d.ts +4 -4
  296. package/lib/idx/authenticate.d.ts +2 -2
  297. package/lib/idx/authenticator/Authenticator.d.ts +4 -5
  298. package/lib/idx/authenticator/OktaPassword.d.ts +7 -9
  299. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +9 -8
  300. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +7 -7
  301. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +6 -2
  302. package/lib/idx/authenticator/WebauthnEnrollment.d.ts +16 -0
  303. package/lib/idx/authenticator/WebauthnVerification.d.ts +17 -0
  304. package/lib/idx/authenticator/getAuthenticator.d.ts +1 -1
  305. package/lib/idx/authenticator/index.d.ts +9 -0
  306. package/lib/idx/cancel.d.ts +2 -2
  307. package/lib/idx/emailVerify.d.ts +26 -0
  308. package/lib/{util/emailVerify.d.ts → idx/flow/AccountUnlockFlow.d.ts} +2 -6
  309. package/lib/idx/flow/FlowSpecification.d.ts +3 -2
  310. package/lib/idx/flow/index.d.ts +1 -0
  311. package/lib/idx/headers.d.ts +3 -2
  312. package/lib/idx/idx-js/client.d.ts +36 -0
  313. package/lib/idx/idx-js/index.d.ts +51 -0
  314. package/lib/idx/idx-js/interact.d.ts +25 -0
  315. package/lib/idx/idx-js/introspect.d.ts +20 -0
  316. package/lib/idx/idx-js/parsers.d.ts +15 -0
  317. package/lib/idx/idx-js/util.d.ts +12 -0
  318. package/lib/idx/idx-js/v1/actionParser.d.ts +16 -0
  319. package/lib/idx/idx-js/v1/generateIdxAction.d.ts +13 -0
  320. package/lib/idx/idx-js/v1/idxResponseParser.d.ts +20 -0
  321. package/lib/idx/idx-js/v1/makeIdxState.d.ts +13 -0
  322. package/lib/idx/idx-js/v1/parsers.d.ts +16 -0
  323. package/lib/idx/idx-js/v1/remediationParser.d.ts +12 -0
  324. package/lib/idx/index.d.ts +12 -10
  325. package/lib/idx/interact.d.ts +7 -13
  326. package/lib/idx/introspect.d.ts +4 -3
  327. package/lib/idx/poll.d.ts +2 -2
  328. package/lib/idx/proceed.d.ts +8 -5
  329. package/lib/idx/recoverPassword.d.ts +2 -2
  330. package/lib/idx/register.d.ts +2 -2
  331. package/lib/idx/remediate.d.ts +10 -4
  332. package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +3 -3
  333. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +3 -3
  334. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +8 -7
  335. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +10 -7
  336. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +8 -12
  337. package/lib/idx/remediators/EnrollPoll.d.ts +1 -1
  338. package/lib/idx/remediators/EnrollProfile.d.ts +1 -1
  339. package/lib/idx/remediators/EnrollmentChannelData.d.ts +54 -0
  340. package/lib/idx/remediators/Identify.d.ts +2 -2
  341. package/lib/idx/remediators/ReEnrollAuthenticator.d.ts +2 -2
  342. package/lib/idx/remediators/RedirectIdp.d.ts +3 -3
  343. package/lib/idx/remediators/SelectAuthenticatorUnlockAccount.d.ts +38 -0
  344. package/lib/idx/remediators/SelectEnrollmentChannel.d.ts +40 -0
  345. package/lib/idx/remediators/index.d.ts +3 -0
  346. package/lib/idx/remediators/util.d.ts +2 -2
  347. package/lib/idx/run.d.ts +5 -3
  348. package/lib/idx/startTransaction.d.ts +3 -2
  349. package/lib/idx/transactionMeta.d.ts +10 -31
  350. package/lib/idx/types/FlowIdentifier.d.ts +1 -1
  351. package/lib/idx/types/idx-js.d.ts +44 -1
  352. package/lib/idx/types/index.d.ts +36 -9
  353. package/lib/idx/unlockAccount.d.ts +15 -0
  354. package/lib/index.d.ts +1 -0
  355. package/lib/oidc/endpoints/well-known.d.ts +3 -3
  356. package/lib/oidc/exchangeCodeForTokens.d.ts +14 -2
  357. package/lib/oidc/getToken.d.ts +2 -2
  358. package/lib/oidc/getWithPopup.d.ts +2 -2
  359. package/lib/oidc/getWithRedirect.d.ts +2 -2
  360. package/lib/oidc/getWithoutPrompt.d.ts +2 -2
  361. package/lib/oidc/handleOAuthResponse.d.ts +2 -2
  362. package/lib/oidc/parseFromUrl.d.ts +1 -1
  363. package/lib/oidc/renewToken.d.ts +2 -2
  364. package/lib/oidc/renewTokens.d.ts +1 -1
  365. package/lib/oidc/renewTokensWithRefresh.d.ts +2 -2
  366. package/lib/oidc/revokeToken.d.ts +2 -2
  367. package/lib/oidc/util/browser.d.ts +3 -3
  368. package/lib/oidc/util/defaultTokenParams.d.ts +2 -2
  369. package/lib/oidc/util/errors.d.ts +2 -2
  370. package/lib/oidc/util/index.d.ts +1 -0
  371. package/lib/oidc/util/loginRedirect.d.ts +4 -4
  372. package/lib/oidc/util/oauth.d.ts +4 -11
  373. package/lib/oidc/util/oauthMeta.d.ts +2 -0
  374. package/lib/oidc/util/prepareTokenParams.d.ts +5 -2
  375. package/lib/oidc/util/validateClaims.d.ts +2 -2
  376. package/lib/oidc/verifyToken.d.ts +2 -2
  377. package/lib/server/serverStorage.d.ts +1 -1
  378. package/lib/services/TokenService.d.ts +2 -2
  379. package/lib/tx/AuthTransaction.d.ts +2 -2
  380. package/lib/tx/TransactionState.d.ts +11 -1
  381. package/lib/tx/api.d.ts +6 -6
  382. package/lib/types/OktaAuthOptions.d.ts +6 -8
  383. package/lib/types/Storage.d.ts +3 -3
  384. package/lib/types/Transaction.d.ts +10 -7
  385. package/lib/types/UserClaims.d.ts +3 -3
  386. package/lib/types/api.d.ts +44 -20
  387. package/lib/types/index.d.ts +0 -1
  388. package/lib/util/console.d.ts +1 -1
  389. package/lib/util/index.d.ts +0 -1
  390. package/lib/util/sharedStorage.d.ts +1 -1
  391. package/lib/util/types.d.ts +1 -1
  392. package/lib/util/url.d.ts +2 -2
  393. package/package.json +10 -7
  394. package/polyfill/index.js +1 -0
  395. package/cjs/util/emailVerify.js +0 -28
  396. package/cjs/util/emailVerify.js.map +0 -1
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.EnrollPoll = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
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"));
14
+
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
16
 
9
17
  var _Remediator = require("./Base/Remediator");
10
18
 
@@ -21,19 +29,18 @@ var _Remediator = require("./Base/Remediator");
21
29
  */
22
30
  class EnrollPoll extends _Remediator.Remediator {
23
31
  canRemediate() {
24
- return Boolean(this.values.startPolling);
32
+ return Boolean((0, _values.default)(this).startPolling);
25
33
  }
26
34
 
27
35
  getNextStep(context) {
28
- const name = this.getName();
36
+ const common = super.getNextStep(context);
29
37
  let authenticator = this.getAuthenticator();
30
38
 
31
39
  if (!authenticator && context !== null && context !== void 0 && context.currentAuthenticator) {
32
40
  authenticator = context.currentAuthenticator.value;
33
41
  }
34
42
 
35
- return {
36
- name,
43
+ return { ...common,
37
44
  authenticator,
38
45
  poll: {
39
46
  required: true,
@@ -43,9 +50,11 @@ class EnrollPoll extends _Remediator.Remediator {
43
50
  }
44
51
 
45
52
  getValuesAfterProceed() {
46
- let trimmedValues = Object.keys(this.values).filter(valueKey => valueKey !== 'startPolling');
47
- return trimmedValues.reduce((values, valueKey) => ({ ...values,
48
- [valueKey]: this.values[valueKey]
53
+ var _context;
54
+
55
+ let trimmedValues = (0, _filter.default)(_context = (0, _keys.default)((0, _values.default)(this))).call(_context, valueKey => valueKey !== 'startPolling');
56
+ return (0, _reduce.default)(trimmedValues).call(trimmedValues, (values, valueKey) => ({ ...values,
57
+ [valueKey]: (0, _values.default)(this)[valueKey]
49
58
  }), {});
50
59
  }
51
60
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../lib/idx/remediators/EnrollPoll.ts"],"names":["EnrollPoll","Remediator","canRemediate","Boolean","values","startPolling","getNextStep","context","name","getName","authenticator","getAuthenticator","currentAuthenticator","value","poll","required","refresh","remediation","getValuesAfterProceed","trimmedValues","Object","keys","filter","valueKey","reduce"],"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,KAAKC,MAAL,CAAYC,YAAb,CAAd;AACD;;AAEDC,EAAAA,WAAW,CAACC,OAAD,EAAiC;AAC1C,UAAMC,IAAI,GAAG,KAAKC,OAAL,EAAb;AACA,QAAIC,aAAa,GAAG,KAAKC,gBAAL,EAApB;;AACA,QAAI,CAACD,aAAD,IAAkBH,OAAlB,aAAkBA,OAAlB,eAAkBA,OAAO,CAAEK,oBAA/B,EAAqD;AACnDF,MAAAA,aAAa,GAAGH,OAAO,CAACK,oBAAR,CAA6BC,KAA7C;AACD;;AACD,WAAO;AACLL,MAAAA,IADK;AAELE,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,GAAY;AAC/B,QAAIC,aAAa,GAAGC,MAAM,CAACC,IAAP,CAAY,KAAKjB,MAAjB,EAAyBkB,MAAzB,CAAgCC,QAAQ,IAAIA,QAAQ,KAAK,cAAzD,CAApB;AACA,WAAOJ,aAAa,CAACK,MAAd,CAAqB,CAACpB,MAAD,EAASmB,QAAT,MAAuB,EAAC,GAAGnB,MAAJ;AAAY,OAACmB,QAAD,GAAY,KAAKnB,MAAL,CAAYmB,QAAZ;AAAxB,KAAvB,CAArB,EAA6F,EAA7F,CAAP;AACD;;AA5BwC;;;8BAA9BvB,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 name = this.getName();\n let authenticator = this.getAuthenticator();\n if (!authenticator && context?.currentAuthenticator) {\n authenticator = context.currentAuthenticator.value;\n }\n return {\n name,\n authenticator,\n poll: {\n required: true,\n refresh: this.remediation.refresh\n },\n };\n }\n\n getValuesAfterProceed(): unknown {\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","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,13 +1,23 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.EnrollProfile = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
8
+
9
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
10
+
11
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
12
+
13
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
14
+
15
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
16
 
9
17
  var _Remediator = require("./Base/Remediator");
10
18
 
19
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
20
+
11
21
  /*!
12
22
  * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
13
23
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -28,11 +38,14 @@ class EnrollProfile extends _Remediator.Remediator {
28
38
  }
29
39
 
30
40
  canRemediate() {
31
- const userProfileFromValues = this.getData().userProfile;
32
- const userProfileFromRemediation = this.remediation.value.find(({
41
+ var _context, _context2;
42
+
43
+ const userProfileFromValues = this.getData().userProfile; // eslint-disable-next-line max-len
44
+
45
+ const userProfileFromRemediation = (0, _find.default)(_context = this.remediation.value).call(_context, ({
33
46
  name
34
47
  }) => name === 'userProfile');
35
- return userProfileFromRemediation.form.value.reduce((canRemediate, curr) => {
48
+ return (0, _reduce.default)(_context2 = userProfileFromRemediation.form.value).call(_context2, (canRemediate, curr) => {
36
49
  if (curr.required) {
37
50
  canRemediate = canRemediate && !!userProfileFromValues[curr.name];
38
51
  }
@@ -46,11 +59,11 @@ class EnrollProfile extends _Remediator.Remediator {
46
59
  value: profileAttributes
47
60
  }
48
61
  }) {
49
- const attributeNames = profileAttributes.map(({
62
+ const attributeNames = (0, _map.default)(profileAttributes).call(profileAttributes, ({
50
63
  name
51
64
  }) => name);
52
- return attributeNames.reduce((attributeValues, attributeName) => this.values[attributeName] ? { ...attributeValues,
53
- [attributeName]: this.values[attributeName]
65
+ return (0, _reduce.default)(attributeNames).call(attributeNames, (attributeValues, attributeName) => (0, _values.default)(this)[attributeName] ? { ...attributeValues,
66
+ [attributeName]: (0, _values.default)(this)[attributeName]
54
67
  } : attributeValues, {});
55
68
  }
56
69
 
@@ -59,7 +72,9 @@ class EnrollProfile extends _Remediator.Remediator {
59
72
  }
60
73
 
61
74
  getErrorMessages(errorRemediation) {
62
- return errorRemediation.value[0].form.value.reduce((errors, field) => {
75
+ var _context3;
76
+
77
+ return (0, _reduce.default)(_context3 = errorRemediation.value[0].form.value).call(_context3, (errors, field) => {
63
78
  if (field.messages) {
64
79
  errors.push(field.messages.value[0].message);
65
80
  }
@@ -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","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"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ exports.EnrollmentChannelData = void 0;
6
+
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
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 _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes"));
14
+
15
+ var _reduce = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/reduce"));
16
+
17
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
18
+
19
+ var _Remediator = require("./Base/Remediator");
20
+
21
+ /*!
22
+ * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
23
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
24
+ *
25
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
26
+ * Unless required by applicable law or agreed to in writing, software
27
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
28
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ *
30
+ * See the License for the specific language governing permissions and limitations under the License.
31
+ */
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
+ getInputEmail() {
42
+ return [{
43
+ name: 'email',
44
+ type: 'string',
45
+ required: true,
46
+ label: 'Email'
47
+ }];
48
+ }
49
+
50
+ getInputPhoneNumber() {
51
+ return [{
52
+ name: 'phoneNumber',
53
+ type: 'string',
54
+ required: true,
55
+ label: 'Phone Number'
56
+ }];
57
+ }
58
+
59
+ canRemediate() {
60
+ return Boolean((0, _values.default)(this).email || (0, _values.default)(this).phoneNumber);
61
+ }
62
+
63
+ getNextStep(context) {
64
+ const common = super.getNextStep();
65
+ const authenticator = context.currentAuthenticator.value;
66
+ return { ...common,
67
+ authenticator
68
+ };
69
+ }
70
+
71
+ getData() {
72
+ return {
73
+ stateHandle: (0, _values.default)(this).stateHandle,
74
+ email: (0, _values.default)(this).email,
75
+ phoneNumber: (0, _values.default)(this).phoneNumber
76
+ };
77
+ }
78
+
79
+ getValuesAfterProceed() {
80
+ var _context;
81
+
82
+ let trimmedValues = (0, _filter.default)(_context = (0, _keys.default)((0, _values.default)(this))).call(_context, valueKey => {
83
+ var _context2;
84
+
85
+ return !(0, _includes.default)(_context2 = ['email', 'phoneNumber']).call(_context2, valueKey);
86
+ });
87
+ return (0, _reduce.default)(trimmedValues).call(trimmedValues, (values, valueKey) => ({ ...values,
88
+ [valueKey]: (0, _values.default)(this)[valueKey]
89
+ }), {});
90
+ }
91
+
92
+ }
93
+
94
+ exports.EnrollmentChannelData = EnrollmentChannelData;
95
+ (0, _defineProperty2.default)(EnrollmentChannelData, "remediationName", 'enrollment-channel-data');
96
+ //# 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","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,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.Identify = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
10
 
9
11
  var _Remediator = require("./Base/Remediator");
10
12
 
@@ -38,7 +40,7 @@ class Identify extends _Remediator.Remediator {
38
40
 
39
41
  mapCredentials() {
40
42
  return {
41
- passcode: this.values.password
43
+ passcode: (0, _values.default)(this).password
42
44
  };
43
45
  }
44
46
 
@@ -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","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,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.ReEnrollAuthenticator = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
10
 
9
11
  var _Remediator = require("./Base/Remediator");
10
12
 
@@ -29,11 +31,12 @@ class ReEnrollAuthenticator extends _Remediator.Remediator {
29
31
 
30
32
  mapCredentials() {
31
33
  return {
32
- passcode: this.values.newPassword
34
+ passcode: (0, _values.default)(this).newPassword
33
35
  };
34
36
  }
35
37
 
36
38
  getInputCredentials(input) {
39
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
37
40
  const challengeType = this.getAuthenticator().type;
38
41
  const name = challengeType === 'password' ? 'newPassword' : 'verificationCode';
39
42
  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","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,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.RedirectIdp = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
8
 
9
9
  var _Remediator = require("./Base/Remediator");
10
10
 
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.ResetAuthenticator = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
8
 
9
9
  var _VerifyAuthenticator = require("./Base/VerifyAuthenticator");
10
10
 
@@ -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"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.SelectAuthenticatorAuthenticate = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
8
+
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
10
 
9
11
  var _SelectAuthenticator = require("./Base/SelectAuthenticator");
10
12
 
@@ -31,10 +33,10 @@ class SelectAuthenticatorAuthenticate extends _SelectAuthenticator.SelectAuthent
31
33
 
32
34
  const hasPasswordInOptions = (_getAuthenticatorFrom = (0, _util.getAuthenticatorFromRemediation)(remediation).options) === null || _getAuthenticatorFrom === void 0 ? void 0 : _getAuthenticatorFrom.some(({
33
35
  relatesTo
34
- }) => relatesTo.key === _types.AuthenticatorKey.OKTA_PASSWORD);
36
+ }) => (relatesTo === null || relatesTo === void 0 ? void 0 : relatesTo.key) === _types.AuthenticatorKey.OKTA_PASSWORD);
35
37
 
36
- if (hasPasswordInOptions && (this.values.flow === 'recoverPassword' || this.values.password)) {
37
- this.values.authenticators = [...this.values.authenticators, {
38
+ if (hasPasswordInOptions && ((0, _values.default)(this).flow === 'recoverPassword' || (0, _values.default)(this).password)) {
39
+ (0, _values.default)(this).authenticators = [...((0, _values.default)(this).authenticators || []), {
38
40
  key: _types.AuthenticatorKey.OKTA_PASSWORD
39
41
  }];
40
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,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,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,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.SelectAuthenticatorEnroll = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
8
 
9
9
  var _SelectAuthenticator = require("./Base/SelectAuthenticator");
10
10
 
@@ -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"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
+
5
+ exports.SelectAuthenticatorUnlockAccount = void 0;
6
+
7
+ var _find = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/find"));
8
+
9
+ var _values = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/values"));
10
+
11
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
12
+
13
+ var _SelectAuthenticator = require("./Base/SelectAuthenticator");
14
+
15
+ /*!
16
+ * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
17
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
18
+ *
19
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
22
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ *
24
+ * See the License for the specific language governing permissions and limitations under the License.
25
+ */
26
+ class SelectAuthenticatorUnlockAccount extends _SelectAuthenticator.SelectAuthenticator {
27
+ constructor(...args) {
28
+ super(...args);
29
+ (0, _defineProperty2.default)(this, "map", {
30
+ authenticator: [],
31
+ identifier: ['username']
32
+ });
33
+ }
34
+
35
+ canRemediate() {
36
+ const identifier = this.getData('identifier');
37
+ return !!identifier && super.canRemediate();
38
+ }
39
+
40
+ mapAuthenticator(remediationValue) {
41
+ var _this$selectedOption, _context, _methodTypeOption$opt, _methodTypeOption$opt2;
42
+
43
+ const authenticatorMap = super.mapAuthenticator(remediationValue);
44
+ const methodTypeOption = (_this$selectedOption = this.selectedOption) === null || _this$selectedOption === void 0 ? void 0 : (0, _find.default)(_context = _this$selectedOption.value.form.value).call(_context, ({
45
+ name
46
+ }) => name === 'methodType'); // defaults to 'manually defined' value
47
+ // 2nd: option may have pre-defined value, like stateHandle
48
+ // 3rd: if only a single OV option is available, default to that option
49
+
50
+ const methodTypeValue = (0, _values.default)(this).methodType || (methodTypeOption === null || methodTypeOption === void 0 ? void 0 : methodTypeOption.value) || (methodTypeOption === null || methodTypeOption === void 0 ? void 0 : (_methodTypeOption$opt = methodTypeOption.options) === null || _methodTypeOption$opt === void 0 ? void 0 : (_methodTypeOption$opt2 = _methodTypeOption$opt[0]) === null || _methodTypeOption$opt2 === void 0 ? void 0 : _methodTypeOption$opt2.value);
51
+
52
+ if (methodTypeValue) {
53
+ return { ...authenticatorMap,
54
+ methodType: methodTypeValue
55
+ };
56
+ }
57
+
58
+ return authenticatorMap;
59
+ }
60
+
61
+ getInputUsername() {
62
+ return {
63
+ name: 'username',
64
+ key: 'string'
65
+ };
66
+ }
67
+
68
+ }
69
+
70
+ exports.SelectAuthenticatorUnlockAccount = SelectAuthenticatorUnlockAccount;
71
+ (0, _defineProperty2.default)(SelectAuthenticatorUnlockAccount, "remediationName", 'select-authenticator-unlock-account');
72
+ //# sourceMappingURL=SelectAuthenticatorUnlockAccount.js.map
@@ -0,0 +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,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
4
4
 
5
5
  exports.SelectEnrollProfile = void 0;
6
6
 
7
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty"));
8
8
 
9
9
  var _Remediator = require("./Base/Remediator");
10
10
 
@@ -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"}