@okta/okta-auth-js 5.9.1 → 5.10.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 (124) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +12 -2
  3. package/cjs/OktaAuth.js +25 -12
  4. package/cjs/OktaAuth.js.map +1 -1
  5. package/cjs/OktaUserAgent.js +2 -2
  6. package/cjs/OktaUserAgent.js.map +1 -1
  7. package/cjs/TokenManager.js +24 -2
  8. package/cjs/TokenManager.js.map +1 -1
  9. package/cjs/idx/authenticator/Authenticator.js +14 -0
  10. package/cjs/idx/authenticator/Authenticator.js.map +1 -0
  11. package/cjs/idx/authenticator/OktaPassword.js +31 -0
  12. package/cjs/idx/authenticator/OktaPassword.js.map +1 -0
  13. package/cjs/idx/authenticator/OktaVerifyTotp.js +17 -0
  14. package/cjs/idx/authenticator/OktaVerifyTotp.js.map +1 -0
  15. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js +50 -0
  16. package/cjs/idx/authenticator/SecurityQuestionEnrollment.js.map +1 -0
  17. package/cjs/idx/authenticator/SecurityQuestionVerification.js +31 -0
  18. package/cjs/idx/authenticator/SecurityQuestionVerification.js.map +1 -0
  19. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js +34 -0
  20. package/cjs/idx/authenticator/VerificationCodeAuthenticator.js.map +1 -0
  21. package/cjs/idx/authenticator/getAuthenticator.js +42 -0
  22. package/cjs/idx/authenticator/getAuthenticator.js.map +1 -0
  23. package/cjs/idx/authenticator/index.js +80 -0
  24. package/cjs/idx/authenticator/index.js.map +1 -0
  25. package/cjs/idx/cancel.js +5 -0
  26. package/cjs/idx/cancel.js.map +1 -1
  27. package/cjs/idx/flow/AuthenticationFlow.js +2 -0
  28. package/cjs/idx/flow/AuthenticationFlow.js.map +1 -1
  29. package/cjs/idx/flow/FlowSpecification.js +1 -11
  30. package/cjs/idx/flow/FlowSpecification.js.map +1 -1
  31. package/cjs/idx/flow/RegistrationFlow.js +1 -0
  32. package/cjs/idx/flow/RegistrationFlow.js.map +1 -1
  33. package/cjs/idx/flow/index.js +0 -52
  34. package/cjs/idx/flow/index.js.map +1 -1
  35. package/cjs/idx/index.js +13 -0
  36. package/cjs/idx/index.js.map +1 -1
  37. package/cjs/idx/interact.js +8 -2
  38. package/cjs/idx/interact.js.map +1 -1
  39. package/cjs/idx/poll.js +59 -0
  40. package/cjs/idx/poll.js.map +1 -0
  41. package/cjs/idx/proceed.js.map +1 -1
  42. package/cjs/idx/register.js +14 -3
  43. package/cjs/idx/register.js.map +1 -1
  44. package/cjs/idx/remediate.js +37 -90
  45. package/cjs/idx/remediate.js.map +1 -1
  46. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js +9 -12
  47. package/cjs/idx/remediators/AuthenticatorEnrollmentData.js.map +1 -1
  48. package/cjs/idx/remediators/AuthenticatorVerificationData.js +6 -9
  49. package/cjs/idx/remediators/AuthenticatorVerificationData.js.map +1 -1
  50. package/cjs/idx/remediators/Base/AuthenticatorData.js +43 -32
  51. package/cjs/idx/remediators/Base/AuthenticatorData.js.map +1 -1
  52. package/cjs/idx/remediators/Base/Remediator.js +51 -20
  53. package/cjs/idx/remediators/Base/Remediator.js.map +1 -1
  54. package/cjs/idx/remediators/Base/SelectAuthenticator.js +16 -16
  55. package/cjs/idx/remediators/Base/SelectAuthenticator.js.map +1 -1
  56. package/cjs/idx/remediators/Base/VerifyAuthenticator.js +8 -28
  57. package/cjs/idx/remediators/Base/VerifyAuthenticator.js.map +1 -1
  58. package/{lib/idx/flow/FlowMonitor.d.ts → cjs/idx/remediators/ChallengePoll.js} +16 -13
  59. package/cjs/idx/remediators/ChallengePoll.js.map +1 -0
  60. package/cjs/idx/remediators/EnrollPoll.js +56 -0
  61. package/cjs/idx/remediators/EnrollPoll.js.map +1 -0
  62. package/cjs/idx/remediators/Identify.js +2 -35
  63. package/cjs/idx/remediators/Identify.js.map +1 -1
  64. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js +23 -2
  65. package/cjs/idx/remediators/SelectAuthenticatorAuthenticate.js.map +1 -1
  66. package/cjs/idx/remediators/Skip.js +7 -0
  67. package/cjs/idx/remediators/Skip.js.map +1 -1
  68. package/cjs/idx/remediators/index.js +26 -0
  69. package/cjs/idx/remediators/index.js.map +1 -1
  70. package/cjs/idx/run.js +0 -8
  71. package/cjs/idx/run.js.map +1 -1
  72. package/cjs/idx/types/idx-js.js.map +1 -1
  73. package/cjs/idx/types/index.js +2 -1
  74. package/cjs/idx/types/index.js.map +1 -1
  75. package/cjs/types/Token.js.map +1 -1
  76. package/dist/okta-auth-js.min.js +1 -1
  77. package/dist/okta-auth-js.min.js.map +1 -1
  78. package/dist/okta-auth-js.umd.js +1 -1
  79. package/dist/okta-auth-js.umd.js.map +1 -1
  80. package/esm/index.js +1409 -1197
  81. package/esm/index.js.map +1 -1
  82. package/lib/TokenManager.d.ts +2 -0
  83. package/lib/idx/authenticator/Authenticator.d.ts +12 -0
  84. package/lib/idx/authenticator/OktaPassword.d.ts +11 -0
  85. package/lib/idx/authenticator/OktaVerifyTotp.d.ts +9 -0
  86. package/lib/idx/authenticator/SecurityQuestionEnrollment.d.ts +28 -0
  87. package/lib/idx/authenticator/SecurityQuestionVerification.d.ts +14 -0
  88. package/lib/idx/authenticator/VerificationCodeAuthenticator.d.ts +10 -0
  89. package/lib/idx/authenticator/getAuthenticator.d.ts +3 -0
  90. package/lib/idx/authenticator/index.d.ts +6 -0
  91. package/lib/idx/flow/FlowSpecification.d.ts +0 -2
  92. package/lib/idx/flow/index.d.ts +0 -4
  93. package/lib/idx/index.d.ts +1 -0
  94. package/lib/idx/interact.d.ts +1 -0
  95. package/lib/idx/{flow/AuthenticationFlowMonitor.d.ts → poll.d.ts} +3 -5
  96. package/lib/idx/proceed.d.ts +2 -1
  97. package/lib/idx/register.d.ts +1 -1
  98. package/lib/idx/remediators/AuthenticatorEnrollmentData.d.ts +9 -5
  99. package/lib/idx/remediators/AuthenticatorVerificationData.d.ts +0 -1
  100. package/lib/idx/remediators/Base/AuthenticatorData.d.ts +8 -3
  101. package/lib/idx/remediators/Base/Remediator.d.ts +9 -6
  102. package/lib/idx/remediators/Base/SelectAuthenticator.d.ts +5 -4
  103. package/lib/idx/remediators/Base/VerifyAuthenticator.d.ts +8 -4
  104. package/lib/idx/{flow/RegistrationFlowMonitor.d.ts → remediators/ChallengePoll.d.ts} +3 -3
  105. package/lib/idx/{flow/PasswordRecoveryFlowMonitor.d.ts → remediators/EnrollPoll.d.ts} +12 -4
  106. package/lib/idx/remediators/Identify.d.ts +0 -3
  107. package/lib/idx/remediators/SelectAuthenticatorAuthenticate.d.ts +6 -2
  108. package/lib/idx/remediators/Skip.d.ts +3 -0
  109. package/lib/idx/remediators/index.d.ts +2 -0
  110. package/lib/idx/run.d.ts +1 -2
  111. package/lib/idx/types/idx-js.d.ts +49 -1
  112. package/lib/idx/types/index.d.ts +8 -2
  113. package/lib/types/OktaAuthOptions.d.ts +1 -0
  114. package/lib/types/Token.d.ts +1 -0
  115. package/lib/types/api.d.ts +4 -2
  116. package/package.json +6 -8
  117. package/cjs/idx/flow/AuthenticationFlowMonitor.js +0 -45
  118. package/cjs/idx/flow/AuthenticationFlowMonitor.js.map +0 -1
  119. package/cjs/idx/flow/FlowMonitor.js +0 -69
  120. package/cjs/idx/flow/FlowMonitor.js.map +0 -1
  121. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js +0 -55
  122. package/cjs/idx/flow/PasswordRecoveryFlowMonitor.js.map +0 -1
  123. package/cjs/idx/flow/RegistrationFlowMonitor.js +0 -35
  124. package/cjs/idx/flow/RegistrationFlowMonitor.js.map +0 -1
package/package.json CHANGED
@@ -2,14 +2,12 @@
2
2
  "private": false,
3
3
  "name": "@okta/okta-auth-js",
4
4
  "description": "The Okta Auth SDK",
5
- "version": "5.9.1",
5
+ "version": "5.10.0",
6
6
  "homepage": "https://github.com/okta/okta-auth-js",
7
7
  "license": "Apache-2.0",
8
8
  "main": "cjs/index.js",
9
9
  "module": "esm/index.js",
10
- "browser": {
11
- "cjs/index.js": "./dist/okta-auth-js.umd.js"
12
- },
10
+ "browser": "dist/okta-auth-js.umd.js",
13
11
  "types": "lib/index.d.ts",
14
12
  "repository": {
15
13
  "type": "git",
@@ -72,7 +70,7 @@
72
70
  },
73
71
  "dependencies": {
74
72
  "@babel/runtime": "^7.12.5",
75
- "@okta/okta-idx-js": "0.22.0",
73
+ "@okta/okta-idx-js": "0.23.0",
76
74
  "@peculiar/webcrypto": "1.1.6",
77
75
  "Base64": "1.1.0",
78
76
  "atob": "^2.1.2",
@@ -171,8 +169,8 @@
171
169
  }
172
170
  },
173
171
  "okta": {
174
- "commitSha": "77c767240cef539a3afbe21c8e8117d8c1121d7b",
175
- "fullVersion": "5.9.1-g77c7672",
176
- "testedSha": "16065f291239478bf5c8b76717ad42aecd42b6e5"
172
+ "commitSha": "4b2245069dc5dcc649fb4003d3fa5cb55db0ade5",
173
+ "fullVersion": "5.10.0-g4b22450",
174
+ "testedSha": "ba58fe6ea838ce2c9867271ea7b199cfffe41a59"
177
175
  }
178
176
  }
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- exports.AuthenticationFlowMonitor = void 0;
4
-
5
- var _FlowMonitor = require("./FlowMonitor");
6
-
7
- /*!
8
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
9
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
10
- *
11
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- *
16
- * See the License for the specific language governing permissions and limitations under the License.
17
- */
18
- class AuthenticationFlowMonitor extends _FlowMonitor.FlowMonitor {
19
- isRemediatorCandidate(remediator, remediations, values) {
20
- var _this$previousRemedia;
21
-
22
- const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
23
- const remediatorName = remediator.getName();
24
-
25
- if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate'].includes(prevRemediatorName)) {
26
- return false;
27
- }
28
-
29
- if (remediatorName === 'select-authenticator-authenticate' && remediations.some(({
30
- name
31
- }) => name === 'challenge-authenticator')) {
32
- return false;
33
- }
34
-
35
- if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
36
- return false;
37
- }
38
-
39
- return super.isRemediatorCandidate(remediator, remediations, values);
40
- }
41
-
42
- }
43
-
44
- exports.AuthenticationFlowMonitor = AuthenticationFlowMonitor;
45
- //# sourceMappingURL=AuthenticationFlowMonitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/flow/AuthenticationFlowMonitor.ts"],"names":["AuthenticationFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name"],"mappings":";;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAMA,yBAAN,SAAwCC,wBAAxC,CAAoD;AACzDC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AAEA,QAAIC,cAAc,KAAK,mCAAnB,IACC,CAAC,mCAAD,EAAsCC,QAAtC,CAA+CJ,kBAA/C,CADL,EACyE;AACvE,aAAO,KAAP;AACD;;AAED,QAAIG,cAAc,KAAK,mCAAnB,IACCL,YAAY,CAACO,IAAb,CAAkB,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,yBAAzC,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,QAAIH,cAAc,KAAK,6BAAnB,IACC,CACC,6BADD,EAEC,+BAFD,EAGCC,QAHD,CAGUJ,kBAHV,CADL,EAIoC;AAClC,aAAO,KAAP;AACD;;AAED,WAAO,MAAMJ,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAxBwD","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 { FlowMonitor } from './FlowMonitor';\n\nexport class AuthenticationFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n \n if (remediatorName === 'select-authenticator-authenticate' \n && ['select-authenticator-authenticate'].includes(prevRemediatorName)) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-authenticate' \n && remediations.some(({ name }) => name === 'challenge-authenticator')) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-enroll' \n && [\n 'select-authenticator-enroll', \n 'authenticator-enrollment-data'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n}\n"],"file":"AuthenticationFlowMonitor.js"}
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- exports.FlowMonitor = void 0;
4
-
5
- var _transactionMeta = require("../transactionMeta");
6
-
7
- /*!
8
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
9
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
10
- *
11
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- *
16
- * See the License for the specific language governing permissions and limitations under the License.
17
- */
18
- class FlowMonitor {
19
- constructor(authClient) {
20
- this.authClient = authClient;
21
- } // detect in-memory loop
22
-
23
-
24
- loopDetected(remediator) {
25
- if (!this.previousRemediator) {
26
- this.previousRemediator = remediator;
27
- return false;
28
- }
29
-
30
- if (this.previousRemediator.getName() === remediator.getName()) {
31
- return true;
32
- }
33
-
34
- this.previousRemediator = remediator;
35
- return false;
36
- }
37
-
38
- isRemediatorCandidate( // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
39
- remediator, remediations, values) {
40
- const remediatorName = remediator.getName();
41
-
42
- if (!values.skip && remediatorName === 'skip') {
43
- return false;
44
- }
45
-
46
- if (values.skip && remediatorName !== 'skip') {
47
- return false;
48
- }
49
-
50
- return true;
51
- }
52
-
53
- async trackRemediations(name) {
54
- let meta = await (0, _transactionMeta.getTransactionMeta)(this.authClient);
55
- const remediations = meta.remediations || [];
56
- meta = { ...meta,
57
- remediations: [...remediations, name]
58
- };
59
- (0, _transactionMeta.saveTransactionMeta)(this.authClient, meta);
60
- }
61
-
62
- isFinished() {
63
- return Promise.resolve(true);
64
- }
65
-
66
- }
67
-
68
- exports.FlowMonitor = FlowMonitor;
69
- //# sourceMappingURL=FlowMonitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/flow/FlowMonitor.ts"],"names":["FlowMonitor","constructor","authClient","loopDetected","remediator","previousRemediator","getName","isRemediatorCandidate","remediations","values","remediatorName","skip","trackRemediations","name","meta","isFinished","Promise","resolve"],"mappings":";;;;AAeA;;AAfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQO,MAAMA,WAAN,CAAkB;AAIvBC,EAAAA,WAAW,CAACC,UAAD,EAAa;AACtB,SAAKA,UAAL,GAAkBA,UAAlB;AACD,GANsB,CAQvB;;;AACAC,EAAAA,YAAY,CAACC,UAAD,EAAkC;AAC5C,QAAI,CAAC,KAAKC,kBAAV,EAA8B;AAC5B,WAAKA,kBAAL,GAA0BD,UAA1B;AACA,aAAO,KAAP;AACD;;AAED,QAAI,KAAKC,kBAAL,CAAwBC,OAAxB,OAAsCF,UAAU,CAACE,OAAX,EAA1C,EAAgE;AAC9D,aAAO,IAAP;AACD;;AAED,SAAKD,kBAAL,GAA0BD,UAA1B;AACA,WAAO,KAAP;AACD;;AAEDG,EAAAA,qBAAqB,EACnB;AACAH,EAAAA,UAFmB,EAEKI,YAFL,EAEsCC,MAFtC,EAGV;AACT,UAAMC,cAAc,GAAGN,UAAU,CAACE,OAAX,EAAvB;;AACA,QAAI,CAACG,MAAM,CAACE,IAAR,IAAgBD,cAAc,KAAK,MAAvC,EAA+C;AAC7C,aAAO,KAAP;AACD;;AACD,QAAID,MAAM,CAACE,IAAP,IAAeD,cAAc,KAAK,MAAtC,EAA8C;AAC5C,aAAO,KAAP;AACD;;AACD,WAAO,IAAP;AACD;;AAEsB,QAAjBE,iBAAiB,CAACC,IAAD,EAAe;AACpC,QAAIC,IAAI,GAAG,MAAM,yCAAmB,KAAKZ,UAAxB,CAAjB;AACA,UAAMM,YAAY,GAAGM,IAAI,CAACN,YAAL,IAAqB,EAA1C;AACAM,IAAAA,IAAI,GAAG,EACL,GAAGA,IADE;AAELN,MAAAA,YAAY,EAAE,CAAC,GAAGA,YAAJ,EAAkBK,IAAlB;AAFT,KAAP;AAIA,8CAAoB,KAAKX,UAAzB,EAAqCY,IAArC;AACD;;AAEDC,EAAAA,UAAU,GAAqB;AAC7B,WAAOC,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;AACD;;AAjDsB","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 { OktaAuth } from '../../types';\nimport { Remediator, RemediationValues, SkipValues } from '../remediators';\nimport { getTransactionMeta, saveTransactionMeta } from '../transactionMeta';\nimport { IdxRemediation } from '../types/idx-js';\n\nexport class FlowMonitor {\n previousRemediator: Remediator;\n authClient: OktaAuth;\n\n constructor(authClient) {\n this.authClient = authClient;\n }\n\n // detect in-memory loop\n loopDetected(remediator: Remediator): boolean {\n if (!this.previousRemediator) {\n this.previousRemediator = remediator;\n return false;\n }\n\n if (this.previousRemediator.getName() === remediator.getName()) {\n return true;\n }\n\n this.previousRemediator = remediator;\n return false;\n }\n\n isRemediatorCandidate(\n // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars\n remediator: Remediator, remediations?: IdxRemediation[], values?: RemediationValues & SkipValues\n ): boolean {\n const remediatorName = remediator.getName();\n if (!values.skip && remediatorName === 'skip') {\n return false;\n }\n if (values.skip && remediatorName !== 'skip') {\n return false;\n }\n return true;\n }\n\n async trackRemediations(name: string) {\n let meta = await getTransactionMeta(this.authClient);\n const remediations = meta.remediations || [];\n meta = { \n ...meta, \n remediations: [...remediations, name]\n };\n saveTransactionMeta(this.authClient, meta);\n }\n\n isFinished(): Promise<boolean> {\n return Promise.resolve(true);\n }\n}\n"],"file":"FlowMonitor.js"}
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- exports.PasswordRecoveryFlowMonitor = void 0;
4
-
5
- var _FlowMonitor = require("./FlowMonitor");
6
-
7
- var _transactionMeta = require("../transactionMeta");
8
-
9
- /*!
10
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
11
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
12
- *
13
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- *
18
- * See the License for the specific language governing permissions and limitations under the License.
19
- */
20
- class PasswordRecoveryFlowMonitor extends _FlowMonitor.FlowMonitor {
21
- isRemediatorCandidate(remediator, remediations, values) {
22
- var _this$previousRemedia;
23
-
24
- const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
25
- const remediatorName = remediator.getName();
26
-
27
- if (remediatorName === 'select-authenticator-authenticate' && ['select-authenticator-authenticate', 'reenroll-authenticator'].includes(prevRemediatorName)) {
28
- return false;
29
- }
30
-
31
- if (remediatorName === 'select-authenticator-authenticate' && remediations.some(({
32
- name
33
- }) => name === 'challenge-authenticator')) {
34
- return false;
35
- }
36
-
37
- return super.isRemediatorCandidate(remediator, remediations, values);
38
- }
39
-
40
- async isFinished() {
41
- const {
42
- remediations
43
- } = await (0, _transactionMeta.getTransactionMeta)(this.authClient);
44
-
45
- if (!remediations.includes('reset-authenticator')) {
46
- return false;
47
- }
48
-
49
- return await super.isFinished();
50
- }
51
-
52
- }
53
-
54
- exports.PasswordRecoveryFlowMonitor = PasswordRecoveryFlowMonitor;
55
- //# sourceMappingURL=PasswordRecoveryFlowMonitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/flow/PasswordRecoveryFlowMonitor.ts"],"names":["PasswordRecoveryFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes","some","name","isFinished","authClient"],"mappings":";;;;AAaA;;AACA;;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMO,MAAMA,2BAAN,SAA0CC,wBAA1C,CAAsD;AAC3DC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AAEA,QAAIC,cAAc,KAAK,mCAAnB,IACC,CACD,mCADC,EAED,wBAFC,EAGDC,QAHC,CAGQJ,kBAHR,CADL,EAIkC;AAChC,aAAO,KAAP;AACD;;AAED,QAAIG,cAAc,KAAK,mCAAnB,IACCL,YAAY,CAACO,IAAb,CAAkB,CAAC;AAAEC,MAAAA;AAAF,KAAD,KAAcA,IAAI,KAAK,yBAAzC,CADL,EAC0E;AACxE,aAAO,KAAP;AACD;;AAED,WAAO,MAAMV,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAEe,QAAVQ,UAAU,GAAG;AACjB,UAAM;AAAET,MAAAA;AAAF,QAAoB,MAAM,yCAAmB,KAAKU,UAAxB,CAAhC;;AACA,QAAI,CAACV,YAAY,CAACM,QAAb,CAAsB,qBAAtB,CAAL,EAAmD;AACjD,aAAO,KAAP;AACD;;AAED,WAAO,MAAM,MAAMG,UAAN,EAAb;AACD;;AA5B0D","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 { FlowMonitor } from './FlowMonitor';\nimport { getTransactionMeta } from '../transactionMeta';\n\nexport class PasswordRecoveryFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n \n if (remediatorName === 'select-authenticator-authenticate' \n && [\n 'select-authenticator-authenticate',\n 'reenroll-authenticator'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n if (remediatorName === 'select-authenticator-authenticate' \n && remediations.some(({ name }) => name === 'challenge-authenticator')) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n\n async isFinished() {\n const { remediations } = await getTransactionMeta(this.authClient);\n if (!remediations.includes('reset-authenticator')) {\n return false;\n }\n\n return await super.isFinished();\n }\n}\n"],"file":"PasswordRecoveryFlowMonitor.js"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- exports.RegistrationFlowMonitor = void 0;
4
-
5
- var _FlowMonitor = require("./FlowMonitor");
6
-
7
- /*!
8
- * Copyright (c) 2015-present, Okta, Inc. and/or its affiliates. All rights reserved.
9
- * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
10
- *
11
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- *
16
- * See the License for the specific language governing permissions and limitations under the License.
17
- */
18
- class RegistrationFlowMonitor extends _FlowMonitor.FlowMonitor {
19
- isRemediatorCandidate(remediator, remediations, values) {
20
- var _this$previousRemedia;
21
-
22
- const prevRemediatorName = (_this$previousRemedia = this.previousRemediator) === null || _this$previousRemedia === void 0 ? void 0 : _this$previousRemedia.getName();
23
- const remediatorName = remediator.getName();
24
-
25
- if (remediatorName === 'select-authenticator-enroll' && ['select-authenticator-enroll', 'authenticator-enrollment-data'].includes(prevRemediatorName)) {
26
- return false;
27
- }
28
-
29
- return super.isRemediatorCandidate(remediator, remediations, values);
30
- }
31
-
32
- }
33
-
34
- exports.RegistrationFlowMonitor = RegistrationFlowMonitor;
35
- //# sourceMappingURL=RegistrationFlowMonitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../lib/idx/flow/RegistrationFlowMonitor.ts"],"names":["RegistrationFlowMonitor","FlowMonitor","isRemediatorCandidate","remediator","remediations","values","prevRemediatorName","previousRemediator","getName","remediatorName","includes"],"mappings":";;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAMA,uBAAN,SAAsCC,wBAAtC,CAAkD;AACvDC,EAAAA,qBAAqB,CAACC,UAAD,EAAaC,YAAb,EAA4BC,MAA5B,EAAqC;AAAA;;AACxD,UAAMC,kBAAkB,4BAAG,KAAKC,kBAAR,0DAAG,sBAAyBC,OAAzB,EAA3B;AACA,UAAMC,cAAc,GAAGN,UAAU,CAACK,OAAX,EAAvB;;AACA,QAAIC,cAAc,KAAK,6BAAnB,IACC,CACC,6BADD,EAEC,+BAFD,EAGCC,QAHD,CAGUJ,kBAHV,CADL,EAIoC;AAClC,aAAO,KAAP;AACD;;AAED,WAAO,MAAMJ,qBAAN,CAA4BC,UAA5B,EAAwCC,YAAxC,EAAsDC,MAAtD,CAAP;AACD;;AAbsD","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 { FlowMonitor } from './FlowMonitor';\n\nexport class RegistrationFlowMonitor extends FlowMonitor {\n isRemediatorCandidate(remediator, remediations?, values?) {\n const prevRemediatorName = this.previousRemediator?.getName();\n const remediatorName = remediator.getName();\n if (remediatorName === 'select-authenticator-enroll' \n && [\n 'select-authenticator-enroll', \n 'authenticator-enrollment-data'\n ].includes(prevRemediatorName)) {\n return false;\n }\n\n return super.isRemediatorCandidate(remediator, remediations, values);\n }\n}\n"],"file":"RegistrationFlowMonitor.js"}