@frontegg/redux-store 7.0.0-alpha.1 → 7.0.0-alpha.10

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 (1082) hide show
  1. package/audits/AuditLogsState/actions.d.ts +9 -0
  2. package/audits/AuditLogsState/actions.js +103 -0
  3. package/audits/AuditLogsState/index.d.ts +3 -47
  4. package/audits/AuditLogsState/index.js +3 -39
  5. package/audits/AuditLogsState/state.d.ts +4 -0
  6. package/audits/AuditLogsState/state.js +12 -0
  7. package/audits/AuditsMetadataState/actions.d.ts +8 -0
  8. package/audits/AuditsMetadataState/actions.js +36 -0
  9. package/audits/AuditsMetadataState/index.d.ts +3 -35
  10. package/audits/AuditsMetadataState/index.js +3 -29
  11. package/audits/AuditsMetadataState/state.d.ts +4 -0
  12. package/audits/AuditsMetadataState/state.js +5 -0
  13. package/audits/index.d.ts +19 -39
  14. package/audits/index.js +11 -21
  15. package/audits/interfaces.d.ts +2 -0
  16. package/audits/interfaces.js +2 -0
  17. package/audits-backward-compatibility/actions.d.ts +12 -0
  18. package/audits-backward-compatibility/actions.js +256 -0
  19. package/audits-backward-compatibility/index.d.ts +5 -0
  20. package/audits-backward-compatibility/index.js +6 -0
  21. package/audits-backward-compatibility/interfaces.d.ts +60 -0
  22. package/audits-backward-compatibility/package.json +6 -0
  23. package/audits-backward-compatibility/state.d.ts +5 -0
  24. package/audits-backward-compatibility/state.js +24 -0
  25. package/auth/AcceptInvitationState/actions.d.ts +12 -0
  26. package/auth/AcceptInvitationState/actions.js +43 -0
  27. package/auth/AcceptInvitationState/index.d.ts +3 -117
  28. package/auth/AcceptInvitationState/index.js +3 -31
  29. package/auth/AcceptInvitationState/state.d.ts +4 -0
  30. package/auth/AcceptInvitationState/state.js +6 -0
  31. package/auth/AccountSettingsState/actions.d.ts +23 -0
  32. package/auth/AccountSettingsState/actions.js +93 -0
  33. package/auth/AccountSettingsState/index.d.ts +3 -124
  34. package/auth/AccountSettingsState/index.js +3 -33
  35. package/auth/AccountSettingsState/state.d.ts +4 -0
  36. package/auth/AccountSettingsState/state.js +5 -0
  37. package/auth/ActivateAccountState/actions.d.ts +26 -0
  38. package/auth/ActivateAccountState/actions.js +192 -0
  39. package/auth/ActivateAccountState/index.d.ts +3 -0
  40. package/auth/ActivateAccountState/index.js +3 -0
  41. package/auth/ActivateAccountState/state.d.ts +4 -0
  42. package/auth/ActivateAccountState/state.js +11 -0
  43. package/auth/ApiTokensState/actions.d.ts +16 -0
  44. package/auth/ApiTokensState/actions.js +371 -0
  45. package/auth/ApiTokensState/index.d.ts +3 -171
  46. package/auth/ApiTokensState/index.js +3 -71
  47. package/auth/ApiTokensState/interfaces.d.ts +4 -1
  48. package/auth/ApiTokensState/state.d.ts +4 -0
  49. package/auth/ApiTokensState/state.js +23 -0
  50. package/auth/ApplicationsState/actions.d.ts +25 -0
  51. package/auth/ApplicationsState/actions.js +221 -0
  52. package/auth/ApplicationsState/helpers.d.ts +3 -0
  53. package/auth/ApplicationsState/helpers.js +13 -0
  54. package/auth/ApplicationsState/index.d.ts +3 -0
  55. package/auth/ApplicationsState/index.js +3 -0
  56. package/auth/ApplicationsState/interfaces.d.ts +12 -0
  57. package/auth/ApplicationsState/state.d.ts +4 -0
  58. package/auth/ApplicationsState/state.js +9 -0
  59. package/auth/CustomLoginState/actions.d.ts +11 -0
  60. package/auth/CustomLoginState/actions.js +116 -0
  61. package/auth/CustomLoginState/index.d.ts +3 -119
  62. package/auth/CustomLoginState/index.js +3 -32
  63. package/auth/CustomLoginState/state.d.ts +4 -0
  64. package/auth/CustomLoginState/state.js +6 -0
  65. package/auth/Entitlements/actions.d.ts +9 -0
  66. package/auth/Entitlements/actions.js +40 -0
  67. package/auth/Entitlements/helpers.d.ts +38 -0
  68. package/auth/Entitlements/helpers.js +66 -0
  69. package/auth/Entitlements/index.d.ts +6 -2
  70. package/auth/Entitlements/index.js +6 -3
  71. package/auth/ForgotPasswordState/actions.d.ts +11 -0
  72. package/auth/ForgotPasswordState/actions.js +84 -0
  73. package/auth/ForgotPasswordState/index.d.ts +3 -121
  74. package/auth/ForgotPasswordState/index.js +3 -40
  75. package/auth/ForgotPasswordState/interfaces.d.ts +2 -2
  76. package/auth/ForgotPasswordState/state.d.ts +4 -0
  77. package/auth/ForgotPasswordState/state.js +9 -0
  78. package/auth/GroupsDialogsState/actions.d.ts +17 -0
  79. package/auth/GroupsDialogsState/actions.js +77 -0
  80. package/auth/GroupsDialogsState/index.d.ts +3 -0
  81. package/auth/GroupsDialogsState/index.js +3 -0
  82. package/auth/GroupsDialogsState/interfaces.d.ts +32 -0
  83. package/auth/GroupsDialogsState/state.d.ts +4 -0
  84. package/auth/GroupsDialogsState/state.js +25 -0
  85. package/auth/GroupsState/actions.d.ts +21 -0
  86. package/auth/GroupsState/actions.js +403 -0
  87. package/auth/GroupsState/index.d.ts +3 -178
  88. package/auth/GroupsState/index.js +3 -58
  89. package/auth/GroupsState/interfaces.d.ts +1 -32
  90. package/auth/GroupsState/interfaces.js +2 -0
  91. package/auth/GroupsState/state.d.ts +4 -0
  92. package/auth/GroupsState/state.js +8 -0
  93. package/auth/ImpersonateState/actions.d.ts +8 -0
  94. package/auth/ImpersonateState/actions.js +52 -0
  95. package/auth/ImpersonateState/index.d.ts +3 -0
  96. package/auth/ImpersonateState/index.js +3 -0
  97. package/auth/ImpersonateState/interfaces.d.ts +14 -0
  98. package/auth/ImpersonateState/state.d.ts +4 -0
  99. package/auth/ImpersonateState/state.js +7 -0
  100. package/auth/LoginState/actions/afterAuthNavigation.actions.d.ts +11 -0
  101. package/auth/LoginState/actions/afterAuthNavigation.actions.js +183 -0
  102. package/auth/LoginState/actions/handleVerifyMFAResponse.actions.d.ts +8 -0
  103. package/auth/LoginState/actions/handleVerifyMFAResponse.actions.js +92 -0
  104. package/auth/LoginState/actions/hostedLoginAuthorize.actions.d.ts +15 -0
  105. package/auth/LoginState/actions/hostedLoginAuthorize.actions.js +203 -0
  106. package/auth/LoginState/actions/index.d.ts +79 -0
  107. package/auth/LoginState/actions/index.js +1298 -0
  108. package/auth/LoginState/actions/mfaRequiredState.actions.d.ts +11 -0
  109. package/auth/LoginState/actions/mfaRequiredState.actions.js +63 -0
  110. package/auth/LoginState/actions/mfaWithAuthenticator.actions.d.ts +8 -0
  111. package/auth/LoginState/actions/mfaWithAuthenticator.actions.js +137 -0
  112. package/auth/LoginState/actions/mfaWithEmailCode.actions.d.ts +10 -0
  113. package/auth/LoginState/actions/mfaWithEmailCode.actions.js +101 -0
  114. package/auth/LoginState/actions/mfaWithSMS.actions.d.ts +10 -0
  115. package/auth/LoginState/actions/mfaWithSMS.actions.js +108 -0
  116. package/auth/LoginState/actions/mfaWithWebAuthn.actions.d.ts +10 -0
  117. package/auth/LoginState/actions/mfaWithWebAuthn.actions.js +119 -0
  118. package/auth/LoginState/consts.d.ts +6 -22
  119. package/auth/LoginState/consts.js +7 -6
  120. package/auth/LoginState/helpers.d.ts +31 -0
  121. package/auth/LoginState/helpers.js +131 -0
  122. package/auth/LoginState/index.d.ts +3 -233
  123. package/auth/LoginState/index.js +3 -142
  124. package/auth/LoginState/interfaces.d.ts +29 -1
  125. package/auth/LoginState/interfaces.js +7 -1
  126. package/auth/LoginState/state.d.ts +4 -0
  127. package/auth/LoginState/state.js +10 -0
  128. package/auth/MSP/actions.d.ts +28 -0
  129. package/auth/MSP/actions.js +962 -0
  130. package/auth/MSP/dialogs/actions.d.ts +25 -0
  131. package/auth/MSP/dialogs/actions.js +124 -0
  132. package/auth/MSP/dialogs/state.d.ts +4 -0
  133. package/auth/MSP/dialogs/state.js +76 -0
  134. package/auth/MSP/helpers/appendChildrenToNode.d.ts +2 -0
  135. package/auth/MSP/helpers/getAccountsWithUsersCount.d.ts +15 -0
  136. package/auth/MSP/helpers/getAccountsWithUsersCount.js +21 -0
  137. package/auth/MSP/helpers/index.d.ts +5 -0
  138. package/auth/MSP/helpers/index.js +5 -0
  139. package/auth/MSP/helpers/removeNodeFromTree.d.ts +2 -0
  140. package/auth/MSP/helpers/updateNodeIsReseller.d.ts +2 -0
  141. package/auth/MSP/helpers/updateNodeIsReseller.js +14 -0
  142. package/auth/MSP/helpers/updateNodeName.d.ts +2 -0
  143. package/auth/MSP/helpers/updateNodeSubAccountAccessType.d.ts +3 -0
  144. package/auth/MSP/helpers/updateNodeSubAccountAccessType.js +13 -0
  145. package/auth/MSP/index.d.ts +5 -1
  146. package/auth/MSP/index.js +5 -1
  147. package/auth/MSP/interfaces/dialogsStateTypes.d.ts +63 -0
  148. package/auth/MSP/interfaces/stateTypes.d.ts +114 -0
  149. package/auth/MSP/interfaces/stateTypes.js +24 -0
  150. package/auth/MSP/state.d.ts +4 -0
  151. package/auth/MSP/state.js +38 -0
  152. package/auth/MfaState/actions.d.ts +24 -0
  153. package/auth/MfaState/actions.js +431 -0
  154. package/auth/MfaState/index.d.ts +3 -157
  155. package/auth/MfaState/index.js +3 -66
  156. package/auth/MfaState/interfaces.d.ts +5 -4
  157. package/auth/MfaState/interfaces.js +1 -0
  158. package/auth/MfaState/state.d.ts +4 -0
  159. package/auth/MfaState/state.js +8 -0
  160. package/auth/PasskeysState/actions.d.ts +12 -0
  161. package/auth/PasskeysState/actions.js +102 -0
  162. package/auth/PasskeysState/index.d.ts +3 -125
  163. package/auth/PasskeysState/index.js +3 -33
  164. package/auth/PasskeysState/state.d.ts +4 -0
  165. package/auth/PasskeysState/state.js +7 -0
  166. package/auth/ProfileState/actions.d.ts +11 -0
  167. package/auth/ProfileState/actions.js +112 -0
  168. package/auth/ProfileState/index.d.ts +3 -122
  169. package/auth/ProfileState/index.js +3 -35
  170. package/auth/ProfileState/state.d.ts +4 -0
  171. package/auth/ProfileState/state.js +6 -0
  172. package/auth/ProvisioningState/actions.d.ts +21 -0
  173. package/auth/ProvisioningState/actions.js +130 -0
  174. package/auth/ProvisioningState/index.d.ts +3 -0
  175. package/auth/ProvisioningState/index.js +3 -0
  176. package/auth/ProvisioningState/state.d.ts +4 -0
  177. package/auth/ProvisioningState/state.js +5 -0
  178. package/auth/ResetPhoneNumberState/actions.d.ts +11 -0
  179. package/auth/ResetPhoneNumberState/actions.js +115 -0
  180. package/auth/ResetPhoneNumberState/index.d.ts +3 -128
  181. package/auth/ResetPhoneNumberState/index.js +3 -38
  182. package/auth/ResetPhoneNumberState/state.d.ts +4 -0
  183. package/auth/ResetPhoneNumberState/state.js +7 -0
  184. package/auth/RolesState/actions.d.ts +24 -0
  185. package/auth/RolesState/actions.js +274 -0
  186. package/auth/RolesState/index.d.ts +3 -132
  187. package/auth/RolesState/index.js +3 -48
  188. package/auth/RolesState/interfaces.d.ts +17 -2
  189. package/auth/RolesState/interfaces.js +8 -1
  190. package/auth/RolesState/state.d.ts +4 -0
  191. package/auth/RolesState/state.js +9 -0
  192. package/auth/SSOState/actions/actions.v1.d.ts +20 -0
  193. package/auth/SSOState/actions/actions.v1.js +387 -0
  194. package/auth/SSOState/actions/actions.v2.d.ts +19 -0
  195. package/auth/SSOState/actions/actions.v2.js +359 -0
  196. package/auth/SSOState/actions/index.d.ts +75 -0
  197. package/auth/SSOState/actions/index.js +6 -0
  198. package/auth/SSOState/index.d.ts +3 -274
  199. package/auth/SSOState/index.js +3 -101
  200. package/auth/SSOState/state.d.ts +4 -0
  201. package/auth/SSOState/state.js +10 -0
  202. package/auth/Security/RestrictionsState/actions.d.ts +24 -0
  203. package/auth/Security/RestrictionsState/actions.js +444 -0
  204. package/auth/Security/RestrictionsState/index.d.ts +3 -214
  205. package/auth/Security/RestrictionsState/index.js +3 -63
  206. package/auth/Security/RestrictionsState/state.d.ts +4 -0
  207. package/auth/Security/RestrictionsState/state.js +18 -0
  208. package/auth/Security/SecurityCenterState/actions.d.ts +17 -0
  209. package/auth/Security/SecurityCenterState/actions.js +308 -0
  210. package/auth/Security/SecurityCenterState/index.d.ts +3 -156
  211. package/auth/Security/SecurityCenterState/index.js +3 -81
  212. package/auth/Security/SecurityCenterState/interfaces.d.ts +28 -1
  213. package/auth/Security/SecurityCenterState/interfaces.js +10 -1
  214. package/auth/Security/SecurityCenterState/state.d.ts +4 -0
  215. package/auth/Security/SecurityCenterState/state.js +40 -0
  216. package/auth/Security/SecurityPolicyState/actions.d.ts +35 -0
  217. package/auth/Security/SecurityPolicyState/actions.js +413 -0
  218. package/auth/Security/SecurityPolicyState/index.d.ts +3 -802
  219. package/auth/Security/SecurityPolicyState/index.js +3 -90
  220. package/auth/Security/SecurityPolicyState/interfaces.d.ts +1 -1
  221. package/auth/Security/SecurityPolicyState/state.d.ts +4 -0
  222. package/auth/Security/SecurityPolicyState/state.js +37 -0
  223. package/auth/Security/SessionsPolicyState/actions.d.ts +10 -0
  224. package/auth/Security/SessionsPolicyState/actions.js +57 -0
  225. package/auth/Security/SessionsPolicyState/index.d.ts +3 -120
  226. package/auth/Security/SessionsPolicyState/index.js +3 -32
  227. package/auth/Security/SessionsPolicyState/state.d.ts +4 -0
  228. package/auth/Security/SessionsPolicyState/state.js +6 -0
  229. package/auth/SessionsState/actions.d.ts +14 -0
  230. package/auth/SessionsState/actions.js +111 -0
  231. package/auth/SessionsState/index.d.ts +3 -137
  232. package/auth/SessionsState/index.js +3 -37
  233. package/auth/SessionsState/interfaces.d.ts +1 -0
  234. package/auth/SessionsState/state.d.ts +4 -0
  235. package/auth/SessionsState/state.js +6 -0
  236. package/auth/SignUpState/actions.d.ts +10 -0
  237. package/auth/SignUpState/actions.js +146 -0
  238. package/auth/SignUpState/index.d.ts +3 -0
  239. package/auth/SignUpState/index.js +3 -0
  240. package/auth/SignUpState/state.d.ts +4 -0
  241. package/auth/SignUpState/state.js +10 -0
  242. package/auth/SmsState/actions.d.ts +15 -0
  243. package/auth/SmsState/actions.js +181 -0
  244. package/auth/SmsState/index.d.ts +3 -0
  245. package/auth/SmsState/index.js +3 -0
  246. package/auth/SmsState/interfaces.d.ts +10 -0
  247. package/auth/SmsState/state.d.ts +4 -0
  248. package/auth/SmsState/state.js +7 -0
  249. package/auth/SocialLoginState/actions.d.ts +14 -0
  250. package/auth/SocialLoginState/actions.js +163 -0
  251. package/auth/SocialLoginState/index.d.ts +3 -0
  252. package/auth/SocialLoginState/index.js +3 -0
  253. package/auth/SocialLoginState/state.d.ts +4 -0
  254. package/auth/SocialLoginState/state.js +7 -0
  255. package/auth/StepUpState/actions/generateStepUpSession.actions.d.ts +6 -0
  256. package/auth/StepUpState/actions/generateStepUpSession.actions.js +104 -0
  257. package/auth/StepUpState/actions/index.d.ts +18 -0
  258. package/auth/StepUpState/actions/index.js +98 -0
  259. package/auth/StepUpState/actions/stepUpHostedLogin.actions.d.ts +6 -0
  260. package/auth/StepUpState/actions/stepUpHostedLogin.actions.js +32 -0
  261. package/auth/StepUpState/consts.d.ts +21 -0
  262. package/auth/StepUpState/consts.js +25 -0
  263. package/auth/StepUpState/helpers.d.ts +29 -0
  264. package/auth/StepUpState/helpers.js +54 -0
  265. package/auth/StepUpState/index.d.ts +3 -0
  266. package/auth/StepUpState/index.js +3 -0
  267. package/auth/StepUpState/interfaces.d.ts +36 -0
  268. package/auth/StepUpState/interfaces.js +1 -0
  269. package/auth/StepUpState/state.d.ts +4 -0
  270. package/auth/StepUpState/state.js +7 -0
  271. package/auth/TeamState/actions/activation-link.actions.d.ts +9 -0
  272. package/auth/TeamState/actions/activation-link.actions.js +84 -0
  273. package/auth/TeamState/actions/index.d.ts +52 -0
  274. package/auth/TeamState/actions/index.js +88 -0
  275. package/auth/TeamState/actions/invitation-link.actions.d.ts +11 -0
  276. package/auth/TeamState/actions/invitation-link.actions.js +131 -0
  277. package/auth/TeamState/actions/sub-tenants.actions.d.ts +11 -0
  278. package/auth/TeamState/actions/sub-tenants.actions.js +214 -0
  279. package/auth/TeamState/actions/users.actions.d.ts +27 -0
  280. package/auth/TeamState/actions/users.actions.js +580 -0
  281. package/auth/TeamState/index.d.ts +3 -211
  282. package/auth/TeamState/index.js +3 -133
  283. package/auth/TeamState/interfaces.d.ts +19 -2
  284. package/auth/TeamState/interfaces.js +2 -0
  285. package/auth/TeamState/state.d.ts +4 -0
  286. package/auth/TeamState/state.js +41 -0
  287. package/auth/TenantsState/actions.d.ts +18 -0
  288. package/auth/TenantsState/actions.js +109 -0
  289. package/auth/TenantsState/index.d.ts +3 -136
  290. package/auth/TenantsState/index.js +3 -42
  291. package/auth/TenantsState/interfaces.d.ts +3 -1
  292. package/auth/TenantsState/state.d.ts +4 -0
  293. package/auth/TenantsState/state.js +8 -0
  294. package/auth/helpers.d.ts +20 -0
  295. package/auth/helpers.js +55 -0
  296. package/auth/index.d.ts +134 -745
  297. package/auth/index.js +205 -67
  298. package/auth/interfaces.d.ts +101 -71
  299. package/auth/interfaces.js +2 -0
  300. package/connectivity/actions.d.ts +44 -0
  301. package/connectivity/actions.js +534 -0
  302. package/connectivity/consts.d.ts +0 -3
  303. package/connectivity/consts.js +3 -23
  304. package/connectivity/index.d.ts +4 -40
  305. package/connectivity/index.js +3 -16
  306. package/connectivity/interfaces.d.ts +6 -5
  307. package/connectivity/state.d.ts +4 -0
  308. package/connectivity/state.js +11 -0
  309. package/constants.d.ts +2 -6
  310. package/constants.js +2 -6
  311. package/helpers/common.d.ts +8 -0
  312. package/helpers/common.js +44 -0
  313. package/helpers/converters.d.ts +3 -0
  314. package/helpers/converters.js +64 -0
  315. package/helpers/encoders.d.ts +2 -0
  316. package/helpers/encoders.js +46 -0
  317. package/helpers/gtm.d.ts +27 -0
  318. package/helpers/gtm.js +25 -0
  319. package/helpers/index.d.ts +6 -0
  320. package/helpers/index.js +6 -0
  321. package/helpers/package.json +6 -0
  322. package/helpers/random.d.ts +4 -0
  323. package/helpers/random.js +28 -0
  324. package/helpers/sha256.d.ts +21 -0
  325. package/helpers/sha256.js +424 -0
  326. package/index.d.ts +11 -12
  327. package/index.js +13 -11
  328. package/interfaces.d.ts +80 -6
  329. package/mocks/audits-mocks/auditLogsActions.mocks.d.ts +13 -0
  330. package/mocks/audits-mocks/auditLogsActions.mocks.js +52 -0
  331. package/mocks/audits-mocks/auditsMetadataActions.mocks.d.ts +7 -0
  332. package/mocks/audits-mocks/auditsMetadataActions.mocks.js +28 -0
  333. package/mocks/audits-mocks/index.d.ts +15 -0
  334. package/mocks/audits-mocks/index.js +8 -0
  335. package/mocks/auth-mocks/acceptInvitationActions.mocks.d.ts +10 -0
  336. package/mocks/auth-mocks/acceptInvitationActions.mocks.js +6 -0
  337. package/mocks/auth-mocks/accountSettingsActions.mocks.d.ts +22 -0
  338. package/mocks/auth-mocks/accountSettingsActions.mocks.js +52 -0
  339. package/mocks/auth-mocks/activateAccountActions.mocks.d.ts +24 -0
  340. package/mocks/auth-mocks/activateAccountActions.mocks.js +7 -0
  341. package/mocks/auth-mocks/allAccountsActions.mocks.d.ts +37 -0
  342. package/mocks/auth-mocks/allAccountsActions.mocks.js +6 -0
  343. package/mocks/auth-mocks/apiTokensActions.mocks.d.ts +17 -0
  344. package/mocks/auth-mocks/apiTokensActions.mocks.js +127 -0
  345. package/mocks/auth-mocks/applicationsActions.mocks.d.ts +23 -0
  346. package/mocks/auth-mocks/applicationsActions.mocks.js +7 -0
  347. package/mocks/auth-mocks/customLoginActions.mocks.d.ts +11 -0
  348. package/mocks/auth-mocks/customLoginActions.mocks.js +32 -0
  349. package/mocks/auth-mocks/entitlementsActions.mocks.d.ts +7 -0
  350. package/mocks/auth-mocks/entitlementsActions.mocks.js +6 -0
  351. package/mocks/auth-mocks/forgotPasswordActions.mocks.d.ts +10 -0
  352. package/mocks/auth-mocks/forgotPasswordActions.mocks.js +30 -0
  353. package/mocks/auth-mocks/groupsActions.mocks.d.ts +33 -0
  354. package/mocks/auth-mocks/groupsActions.mocks.js +234 -0
  355. package/mocks/auth-mocks/impersonateActions.mocks.d.ts +7 -0
  356. package/mocks/auth-mocks/impersonateActions.mocks.js +6 -0
  357. package/mocks/auth-mocks/index.d.ts +6 -0
  358. package/mocks/auth-mocks/index.js +130 -0
  359. package/mocks/auth-mocks/loginActions.mocks.d.ts +77 -0
  360. package/mocks/auth-mocks/loginActions.mocks.js +39 -0
  361. package/mocks/auth-mocks/mfaActions.mocks.d.ts +29 -0
  362. package/mocks/auth-mocks/mfaActions.mocks.js +220 -0
  363. package/mocks/auth-mocks/passkeysActions.mocks.d.ts +11 -0
  364. package/mocks/auth-mocks/passkeysActions.mocks.js +6 -0
  365. package/mocks/auth-mocks/profileActions.mocks.d.ts +10 -0
  366. package/mocks/auth-mocks/profileActions.mocks.js +67 -0
  367. package/mocks/auth-mocks/provisioningActions.mocks.d.ts +19 -0
  368. package/mocks/auth-mocks/provisioningActions.mocks.js +6 -0
  369. package/mocks/auth-mocks/resetPhoneNumberActions.mocks.d.ts +12 -0
  370. package/mocks/auth-mocks/resetPhoneNumberActions.mocks.js +6 -0
  371. package/mocks/auth-mocks/rolesActions.mocks.d.ts +17 -0
  372. package/mocks/auth-mocks/rolesActions.mocks.js +33 -0
  373. package/mocks/auth-mocks/security/restrictionsActions.mocks.d.ts +23 -0
  374. package/mocks/auth-mocks/security/restrictionsActions.mocks.js +248 -0
  375. package/mocks/auth-mocks/security/securityCenterActions.mocks.d.ts +16 -0
  376. package/mocks/auth-mocks/security/securityCenterActions.mocks.js +102 -0
  377. package/mocks/auth-mocks/security/securityPolicyActions.mocks.d.ts +56 -0
  378. package/mocks/auth-mocks/security/securityPolicyActions.mocks.js +179 -0
  379. package/mocks/auth-mocks/security/sessionsPolicyActions.mocks.d.ts +10 -0
  380. package/mocks/auth-mocks/security/sessionsPolicyActions.mocks.js +35 -0
  381. package/mocks/auth-mocks/sessionsActions.mocks.d.ts +13 -0
  382. package/mocks/auth-mocks/sessionsActions.mocks.js +44 -0
  383. package/mocks/auth-mocks/signUpActions.mocks.d.ts +9 -0
  384. package/mocks/auth-mocks/signUpActions.mocks.js +6 -0
  385. package/mocks/auth-mocks/smsActions.mocks.d.ts +12 -0
  386. package/mocks/auth-mocks/smsActions.mocks.js +6 -0
  387. package/mocks/auth-mocks/socialLoginActions.mocks.d.ts +12 -0
  388. package/mocks/auth-mocks/socialLoginActions.mocks.js +6 -0
  389. package/mocks/auth-mocks/ssoActions.mocks.d.ts +77 -0
  390. package/mocks/auth-mocks/ssoActions.mocks.js +128 -0
  391. package/mocks/auth-mocks/stepUpActions.mocks.d.ts +15 -0
  392. package/mocks/auth-mocks/stepUpActions.mocks.js +6 -0
  393. package/mocks/auth-mocks/teamActions.mocks.d.ts +52 -0
  394. package/mocks/auth-mocks/teamActions.mocks.js +378 -0
  395. package/mocks/auth-mocks/tenantsActions.mocks.d.ts +16 -0
  396. package/mocks/auth-mocks/tenantsActions.mocks.js +18 -0
  397. package/mocks/connectivity-mocks/index.d.ts +41 -0
  398. package/mocks/connectivity-mocks/index.js +7 -0
  399. package/mocks/dummy.d.ts +41 -0
  400. package/mocks/dummy.js +965 -0
  401. package/mocks/helpers.d.ts +1 -0
  402. package/mocks/helpers.js +16 -0
  403. package/mocks/index.d.ts +68 -0
  404. package/mocks/index.js +25 -0
  405. package/mocks/package.json +6 -0
  406. package/mocks/subscriptions-mocks/billingActions-mocks/index.d.ts +4 -0
  407. package/mocks/subscriptions-mocks/billingActions-mocks/index.js +17 -0
  408. package/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.d.ts +8 -0
  409. package/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.js +36 -0
  410. package/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.d.ts +10 -0
  411. package/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.js +27 -0
  412. package/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.d.ts +11 -0
  413. package/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.js +20 -0
  414. package/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.d.ts +14 -0
  415. package/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.js +21 -0
  416. package/mocks/subscriptions-mocks/checkoutActions.mocks.d.ts +11 -0
  417. package/mocks/subscriptions-mocks/checkoutActions.mocks.js +7 -0
  418. package/mocks/subscriptions-mocks/configActions.mocks.d.ts +7 -0
  419. package/mocks/subscriptions-mocks/configActions.mocks.js +23 -0
  420. package/mocks/subscriptions-mocks/index.d.ts +3 -0
  421. package/mocks/subscriptions-mocks/index.js +23 -0
  422. package/mocks/subscriptions-mocks/plansActions.mocks.d.ts +7 -0
  423. package/mocks/subscriptions-mocks/plansActions.mocks.js +28 -0
  424. package/mocks/subscriptions-mocks/stripeActions.mocks.d.ts +5 -0
  425. package/mocks/subscriptions-mocks/stripeActions.mocks.js +6 -0
  426. package/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.d.ts +9 -0
  427. package/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.js +18 -0
  428. package/mocks/vendor-mocks/index.d.ts +7 -0
  429. package/mocks/vendor-mocks/index.js +19 -0
  430. package/node/audits/AuditLogsState/actions.js +111 -0
  431. package/node/audits/AuditLogsState/index.js +14 -41
  432. package/node/audits/AuditLogsState/state.js +20 -0
  433. package/node/audits/AuditsMetadataState/actions.js +43 -0
  434. package/node/audits/AuditsMetadataState/index.js +14 -31
  435. package/node/audits/AuditsMetadataState/state.js +13 -0
  436. package/node/audits/index.js +13 -117
  437. package/node/audits/interfaces.js +22 -0
  438. package/node/audits-backward-compatibility/actions.js +265 -0
  439. package/node/audits-backward-compatibility/index.js +20 -0
  440. package/node/audits-backward-compatibility/state.js +32 -0
  441. package/node/auth/AcceptInvitationState/actions.js +50 -0
  442. package/node/auth/AcceptInvitationState/index.js +15 -33
  443. package/node/auth/AcceptInvitationState/state.js +14 -0
  444. package/node/auth/AccountSettingsState/actions.js +101 -0
  445. package/node/auth/AccountSettingsState/index.js +15 -35
  446. package/node/auth/AccountSettingsState/state.js +13 -0
  447. package/node/auth/ActivateAccountState/actions.js +200 -0
  448. package/node/auth/ActivateAccountState/index.js +20 -0
  449. package/node/auth/ActivateAccountState/state.js +19 -0
  450. package/node/auth/ApiTokensState/actions.js +379 -0
  451. package/node/auth/ApiTokensState/index.js +15 -73
  452. package/node/auth/ApiTokensState/state.js +31 -0
  453. package/node/auth/ApplicationsState/actions.js +229 -0
  454. package/node/auth/ApplicationsState/helpers.js +20 -0
  455. package/node/auth/ApplicationsState/index.js +20 -0
  456. package/node/auth/ApplicationsState/state.js +17 -0
  457. package/node/auth/CustomLoginState/actions.js +124 -0
  458. package/node/auth/CustomLoginState/index.js +15 -34
  459. package/node/auth/CustomLoginState/state.js +14 -0
  460. package/node/auth/Entitlements/actions.js +47 -0
  461. package/node/auth/Entitlements/helpers.js +77 -0
  462. package/node/auth/Entitlements/index.js +7 -21
  463. package/node/auth/ForgotPasswordState/actions.js +92 -0
  464. package/node/auth/ForgotPasswordState/index.js +15 -42
  465. package/node/auth/ForgotPasswordState/state.js +17 -0
  466. package/node/auth/GroupsDialogsState/actions.js +85 -0
  467. package/node/auth/GroupsDialogsState/index.js +20 -0
  468. package/node/auth/GroupsDialogsState/state.js +33 -0
  469. package/node/auth/GroupsState/actions.js +411 -0
  470. package/node/auth/GroupsState/index.js +15 -61
  471. package/node/auth/GroupsState/interfaces.js +1 -0
  472. package/node/auth/GroupsState/state.js +16 -0
  473. package/node/auth/ImpersonateState/actions.js +60 -0
  474. package/node/auth/ImpersonateState/index.js +20 -0
  475. package/node/auth/ImpersonateState/state.js +15 -0
  476. package/node/auth/LoginState/actions/afterAuthNavigation.actions.js +191 -0
  477. package/node/auth/LoginState/actions/handleVerifyMFAResponse.actions.js +98 -0
  478. package/node/auth/LoginState/actions/hostedLoginAuthorize.actions.js +211 -0
  479. package/node/auth/LoginState/actions/index.js +1304 -0
  480. package/node/auth/LoginState/actions/mfaRequiredState.actions.js +71 -0
  481. package/node/auth/LoginState/actions/mfaWithAuthenticator.actions.js +145 -0
  482. package/node/auth/LoginState/actions/mfaWithEmailCode.actions.js +109 -0
  483. package/node/auth/LoginState/actions/mfaWithSMS.actions.js +116 -0
  484. package/node/auth/LoginState/actions/mfaWithWebAuthn.actions.js +127 -0
  485. package/node/auth/LoginState/consts.js +7 -6
  486. package/node/auth/LoginState/helpers.js +150 -0
  487. package/node/auth/LoginState/index.js +11 -146
  488. package/node/auth/LoginState/interfaces.js +9 -2
  489. package/node/auth/LoginState/state.js +18 -0
  490. package/node/auth/MSP/actions.js +970 -0
  491. package/node/auth/MSP/dialogs/actions.js +132 -0
  492. package/node/auth/MSP/dialogs/state.js +84 -0
  493. package/node/auth/MSP/helpers/getAccountsWithUsersCount.js +28 -0
  494. package/node/auth/MSP/helpers/index.js +60 -0
  495. package/node/auth/MSP/helpers/updateNodeIsReseller.js +22 -0
  496. package/node/auth/MSP/helpers/updateNodeSubAccountAccessType.js +21 -0
  497. package/node/auth/MSP/index.js +29 -11
  498. package/node/auth/MSP/interfaces/stateTypes.js +29 -0
  499. package/node/auth/MSP/state.js +46 -0
  500. package/node/auth/MfaState/actions.js +439 -0
  501. package/node/auth/MfaState/index.js +15 -68
  502. package/node/auth/MfaState/interfaces.js +1 -0
  503. package/node/auth/MfaState/state.js +16 -0
  504. package/node/auth/PasskeysState/actions.js +109 -0
  505. package/node/auth/PasskeysState/index.js +15 -35
  506. package/node/auth/PasskeysState/state.js +15 -0
  507. package/node/auth/ProfileState/actions.js +120 -0
  508. package/node/auth/ProfileState/index.js +15 -37
  509. package/node/auth/ProfileState/state.js +14 -0
  510. package/node/auth/ProvisioningState/actions.js +138 -0
  511. package/node/auth/ProvisioningState/index.js +20 -0
  512. package/node/auth/ProvisioningState/state.js +13 -0
  513. package/node/auth/ResetPhoneNumberState/actions.js +123 -0
  514. package/node/auth/ResetPhoneNumberState/index.js +15 -40
  515. package/node/auth/ResetPhoneNumberState/state.js +15 -0
  516. package/node/auth/RolesState/actions.js +282 -0
  517. package/node/auth/RolesState/index.js +15 -50
  518. package/node/auth/RolesState/interfaces.js +11 -1
  519. package/node/auth/RolesState/state.js +17 -0
  520. package/node/auth/SSOState/actions/actions.v1.js +395 -0
  521. package/node/auth/SSOState/actions/actions.v2.js +367 -0
  522. package/node/auth/SSOState/actions/index.js +14 -0
  523. package/node/auth/SSOState/index.js +15 -103
  524. package/node/auth/SSOState/state.js +18 -0
  525. package/node/auth/Security/RestrictionsState/actions.js +452 -0
  526. package/node/auth/Security/RestrictionsState/index.js +14 -64
  527. package/node/auth/Security/RestrictionsState/state.js +26 -0
  528. package/node/auth/Security/SecurityCenterState/actions.js +316 -0
  529. package/node/auth/Security/SecurityCenterState/index.js +14 -82
  530. package/node/auth/Security/SecurityCenterState/interfaces.js +13 -1
  531. package/node/auth/Security/SecurityCenterState/state.js +48 -0
  532. package/node/auth/Security/SecurityPolicyState/actions.js +421 -0
  533. package/node/auth/Security/SecurityPolicyState/index.js +14 -91
  534. package/node/auth/Security/SecurityPolicyState/state.js +45 -0
  535. package/node/auth/Security/SessionsPolicyState/actions.js +65 -0
  536. package/node/auth/Security/SessionsPolicyState/index.js +15 -34
  537. package/node/auth/Security/SessionsPolicyState/state.js +14 -0
  538. package/node/auth/SessionsState/actions.js +118 -0
  539. package/node/auth/SessionsState/index.js +15 -39
  540. package/node/auth/SessionsState/state.js +14 -0
  541. package/node/auth/SignUpState/actions.js +154 -0
  542. package/node/auth/SignUpState/index.js +20 -0
  543. package/node/auth/SignUpState/state.js +18 -0
  544. package/node/auth/SmsState/actions.js +189 -0
  545. package/node/auth/SmsState/index.js +20 -0
  546. package/node/auth/SmsState/state.js +15 -0
  547. package/node/auth/SocialLoginState/actions.js +171 -0
  548. package/node/auth/SocialLoginState/index.js +20 -0
  549. package/node/auth/SocialLoginState/state.js +15 -0
  550. package/node/auth/StepUpState/actions/generateStepUpSession.actions.js +111 -0
  551. package/node/auth/StepUpState/actions/index.js +106 -0
  552. package/node/auth/StepUpState/actions/stepUpHostedLogin.actions.js +39 -0
  553. package/node/auth/StepUpState/consts.js +36 -0
  554. package/node/auth/StepUpState/helpers.js +63 -0
  555. package/node/auth/StepUpState/index.js +20 -0
  556. package/node/auth/StepUpState/interfaces.js +5 -0
  557. package/node/auth/StepUpState/state.js +15 -0
  558. package/node/auth/TeamState/actions/activation-link.actions.js +92 -0
  559. package/node/auth/TeamState/actions/index.js +96 -0
  560. package/node/auth/TeamState/actions/invitation-link.actions.js +139 -0
  561. package/node/auth/TeamState/actions/sub-tenants.actions.js +222 -0
  562. package/node/auth/TeamState/actions/users.actions.js +588 -0
  563. package/node/auth/TeamState/index.js +14 -134
  564. package/node/auth/TeamState/interfaces.js +2 -0
  565. package/node/auth/TeamState/state.js +49 -0
  566. package/node/auth/TenantsState/actions.js +116 -0
  567. package/node/auth/TenantsState/index.js +15 -44
  568. package/node/auth/TenantsState/state.js +16 -0
  569. package/node/auth/helpers.js +107 -0
  570. package/node/auth/index.js +237 -422
  571. package/node/auth/interfaces.js +1 -1
  572. package/node/connectivity/actions.js +542 -0
  573. package/node/connectivity/consts.js +4 -28
  574. package/node/connectivity/index.js +7 -55
  575. package/node/connectivity/state.js +19 -0
  576. package/node/constants.js +30 -14
  577. package/node/helpers/common.js +57 -0
  578. package/node/helpers/converters.js +73 -0
  579. package/node/helpers/encoders.js +54 -0
  580. package/node/helpers/gtm.js +31 -0
  581. package/node/helpers/index.js +71 -0
  582. package/node/helpers/random.js +37 -0
  583. package/node/index.js +90 -72
  584. package/node/mocks/audits-mocks/auditLogsActions.mocks.js +59 -0
  585. package/node/mocks/audits-mocks/auditsMetadataActions.mocks.js +35 -0
  586. package/node/mocks/audits-mocks/index.js +16 -0
  587. package/node/mocks/auth-mocks/acceptInvitationActions.mocks.js +13 -0
  588. package/node/mocks/auth-mocks/accountSettingsActions.mocks.js +60 -0
  589. package/node/mocks/auth-mocks/activateAccountActions.mocks.js +14 -0
  590. package/node/mocks/auth-mocks/allAccountsActions.mocks.js +13 -0
  591. package/node/mocks/auth-mocks/apiTokensActions.mocks.js +135 -0
  592. package/node/mocks/auth-mocks/applicationsActions.mocks.js +14 -0
  593. package/node/mocks/auth-mocks/customLoginActions.mocks.js +39 -0
  594. package/node/mocks/auth-mocks/entitlementsActions.mocks.js +13 -0
  595. package/node/mocks/auth-mocks/forgotPasswordActions.mocks.js +37 -0
  596. package/node/mocks/auth-mocks/groupsActions.mocks.js +242 -0
  597. package/node/mocks/auth-mocks/impersonateActions.mocks.js +13 -0
  598. package/node/mocks/auth-mocks/index.js +140 -0
  599. package/node/mocks/auth-mocks/loginActions.mocks.js +46 -0
  600. package/node/mocks/auth-mocks/mfaActions.mocks.js +228 -0
  601. package/node/mocks/auth-mocks/passkeysActions.mocks.js +13 -0
  602. package/node/mocks/auth-mocks/profileActions.mocks.js +75 -0
  603. package/node/mocks/auth-mocks/provisioningActions.mocks.js +13 -0
  604. package/node/mocks/auth-mocks/resetPhoneNumberActions.mocks.js +13 -0
  605. package/node/mocks/auth-mocks/rolesActions.mocks.js +40 -0
  606. package/node/mocks/auth-mocks/security/restrictionsActions.mocks.js +256 -0
  607. package/node/mocks/auth-mocks/security/securityCenterActions.mocks.js +109 -0
  608. package/node/mocks/auth-mocks/security/securityPolicyActions.mocks.js +187 -0
  609. package/node/mocks/auth-mocks/security/sessionsPolicyActions.mocks.js +43 -0
  610. package/node/mocks/auth-mocks/sessionsActions.mocks.js +51 -0
  611. package/node/mocks/auth-mocks/signUpActions.mocks.js +13 -0
  612. package/node/mocks/auth-mocks/smsActions.mocks.js +13 -0
  613. package/node/mocks/auth-mocks/socialLoginActions.mocks.js +13 -0
  614. package/node/mocks/auth-mocks/ssoActions.mocks.js +136 -0
  615. package/node/mocks/auth-mocks/stepUpActions.mocks.js +13 -0
  616. package/node/mocks/auth-mocks/teamActions.mocks.js +386 -0
  617. package/node/mocks/auth-mocks/tenantsActions.mocks.js +25 -0
  618. package/node/mocks/connectivity-mocks/index.js +14 -0
  619. package/node/mocks/dummy.js +1010 -0
  620. package/node/mocks/helpers.js +24 -0
  621. package/node/mocks/index.js +32 -0
  622. package/node/mocks/subscriptions-mocks/billingActions-mocks/index.js +25 -0
  623. package/node/mocks/subscriptions-mocks/billingActions-mocks/informationActions.mocks.js +44 -0
  624. package/node/mocks/subscriptions-mocks/billingActions-mocks/invoicesActions.mocks.js +35 -0
  625. package/node/mocks/subscriptions-mocks/billingActions-mocks/paymentMethodActions.mocks.js +27 -0
  626. package/node/mocks/subscriptions-mocks/billingActions-mocks/subscriptionActions.mocks.js +28 -0
  627. package/node/mocks/subscriptions-mocks/checkoutActions.mocks.js +14 -0
  628. package/node/mocks/subscriptions-mocks/configActions.mocks.js +30 -0
  629. package/node/mocks/subscriptions-mocks/index.js +31 -0
  630. package/node/mocks/subscriptions-mocks/plansActions.mocks.js +36 -0
  631. package/node/mocks/subscriptions-mocks/stripeActions.mocks.js +13 -0
  632. package/node/mocks/subscriptions-mocks/vendorPublicConfigActions.mocks.js +25 -0
  633. package/node/mocks/vendor-mocks/index.js +26 -0
  634. package/node/subscriptions/Billing/Information/actions.js +96 -0
  635. package/node/subscriptions/Billing/Information/index.js +13 -28
  636. package/node/subscriptions/Billing/Information/state.js +15 -0
  637. package/node/subscriptions/Billing/Invoices/actions.js +80 -0
  638. package/node/subscriptions/Billing/Invoices/index.js +11 -40
  639. package/node/subscriptions/Billing/Invoices/state.js +20 -0
  640. package/node/subscriptions/Billing/PaymentMethod/actions.js +92 -0
  641. package/node/subscriptions/Billing/PaymentMethod/index.js +11 -37
  642. package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
  643. package/node/subscriptions/Billing/PaymentMethod/state.js +15 -0
  644. package/node/subscriptions/Billing/Subscription/actions.js +145 -0
  645. package/node/subscriptions/Billing/Subscription/index.js +11 -38
  646. package/node/subscriptions/Billing/Subscription/state.js +23 -0
  647. package/node/subscriptions/Billing/index.js +25 -22
  648. package/node/subscriptions/Checkout/actions.js +108 -0
  649. package/node/subscriptions/Checkout/index.js +13 -34
  650. package/node/subscriptions/Checkout/state.js +16 -0
  651. package/node/subscriptions/Config/actions.js +69 -0
  652. package/node/subscriptions/Config/index.js +13 -26
  653. package/node/subscriptions/Config/state.js +16 -0
  654. package/node/subscriptions/Plans/actions.js +56 -0
  655. package/node/subscriptions/Plans/index.js +13 -25
  656. package/node/subscriptions/Plans/state.js +16 -0
  657. package/node/subscriptions/Stripe/actions.js +50 -0
  658. package/node/subscriptions/Stripe/index.js +13 -26
  659. package/node/subscriptions/Stripe/state.js +15 -0
  660. package/node/subscriptions/VendorPublicConfig/actions.js +51 -0
  661. package/node/subscriptions/VendorPublicConfig/index.js +13 -24
  662. package/node/subscriptions/VendorPublicConfig/state.js +15 -0
  663. package/node/subscriptions/helpers.js +36 -0
  664. package/node/subscriptions/index.js +98 -55
  665. package/node/subscriptions/interfaces.js +20 -77
  666. package/node/toolkit/FronteggNativeModule.js +64 -0
  667. package/node/toolkit/index.js +22 -146
  668. package/node/toolkit/proxy.js +17 -0
  669. package/node/toolkit/store.js +233 -0
  670. package/node/vendor/actions.js +46 -0
  671. package/node/vendor/index.js +7 -55
  672. package/node/vendor/state.js +13 -0
  673. package/package.json +6 -5
  674. package/subscriptions/Billing/Information/actions.d.ts +9 -0
  675. package/subscriptions/Billing/Information/actions.js +88 -0
  676. package/subscriptions/Billing/Information/index.d.ts +3 -12
  677. package/subscriptions/Billing/Information/index.js +3 -26
  678. package/subscriptions/Billing/Information/interfaces.d.ts +1 -1
  679. package/subscriptions/Billing/Information/state.d.ts +4 -0
  680. package/subscriptions/Billing/Information/state.js +7 -0
  681. package/subscriptions/Billing/Invoices/actions.d.ts +11 -0
  682. package/subscriptions/Billing/Invoices/actions.js +73 -0
  683. package/subscriptions/Billing/Invoices/index.d.ts +3 -18
  684. package/subscriptions/Billing/Invoices/index.js +3 -40
  685. package/subscriptions/Billing/Invoices/interfaces.d.ts +1 -1
  686. package/subscriptions/Billing/Invoices/state.d.ts +4 -0
  687. package/subscriptions/Billing/Invoices/state.js +12 -0
  688. package/subscriptions/Billing/PaymentMethod/actions.d.ts +12 -0
  689. package/subscriptions/Billing/PaymentMethod/actions.js +84 -0
  690. package/subscriptions/Billing/PaymentMethod/index.d.ts +3 -20
  691. package/subscriptions/Billing/PaymentMethod/index.js +3 -37
  692. package/subscriptions/Billing/PaymentMethod/interfaces.d.ts +1 -1
  693. package/subscriptions/Billing/PaymentMethod/interfaces.js +0 -2
  694. package/subscriptions/Billing/PaymentMethod/state.d.ts +4 -0
  695. package/subscriptions/Billing/PaymentMethod/state.js +7 -0
  696. package/subscriptions/Billing/Subscription/actions.d.ts +14 -0
  697. package/subscriptions/Billing/Subscription/actions.js +138 -0
  698. package/subscriptions/Billing/Subscription/index.d.ts +3 -16
  699. package/subscriptions/Billing/Subscription/index.js +3 -38
  700. package/subscriptions/Billing/Subscription/interfaces.d.ts +0 -3
  701. package/subscriptions/Billing/Subscription/state.d.ts +4 -0
  702. package/subscriptions/Billing/Subscription/state.js +15 -0
  703. package/subscriptions/Billing/index.d.ts +13 -52
  704. package/subscriptions/Billing/index.js +25 -22
  705. package/subscriptions/Billing/interfaces.d.ts +4 -10
  706. package/subscriptions/Billing/interfaces.js +0 -2
  707. package/subscriptions/Checkout/actions.d.ts +12 -0
  708. package/subscriptions/Checkout/actions.js +100 -0
  709. package/subscriptions/Checkout/index.d.ts +3 -14
  710. package/subscriptions/Checkout/index.js +3 -32
  711. package/subscriptions/Checkout/interfaces.d.ts +0 -7
  712. package/subscriptions/Checkout/state.d.ts +4 -0
  713. package/subscriptions/Checkout/state.js +8 -0
  714. package/subscriptions/Config/actions.d.ts +8 -0
  715. package/subscriptions/Config/actions.js +62 -0
  716. package/subscriptions/Config/index.d.ts +3 -10
  717. package/subscriptions/Config/index.js +3 -24
  718. package/subscriptions/Config/interfaces.d.ts +1 -1
  719. package/subscriptions/Config/state.d.ts +4 -0
  720. package/subscriptions/Config/state.js +8 -0
  721. package/subscriptions/Plans/actions.d.ts +8 -0
  722. package/subscriptions/Plans/actions.js +49 -0
  723. package/subscriptions/Plans/index.d.ts +3 -10
  724. package/subscriptions/Plans/index.js +3 -23
  725. package/subscriptions/Plans/interfaces.d.ts +1 -4
  726. package/subscriptions/Plans/state.d.ts +4 -0
  727. package/subscriptions/Plans/state.js +8 -0
  728. package/subscriptions/Stripe/actions.d.ts +6 -0
  729. package/subscriptions/Stripe/actions.js +43 -0
  730. package/subscriptions/Stripe/index.d.ts +3 -11
  731. package/subscriptions/Stripe/index.js +3 -24
  732. package/subscriptions/Stripe/state.d.ts +4 -0
  733. package/subscriptions/Stripe/state.js +7 -0
  734. package/subscriptions/VendorPublicConfig/actions.d.ts +10 -0
  735. package/subscriptions/VendorPublicConfig/actions.js +44 -0
  736. package/subscriptions/VendorPublicConfig/index.d.ts +3 -10
  737. package/subscriptions/VendorPublicConfig/index.js +3 -22
  738. package/subscriptions/VendorPublicConfig/state.d.ts +4 -0
  739. package/subscriptions/VendorPublicConfig/state.js +7 -0
  740. package/subscriptions/helpers.d.ts +5 -0
  741. package/subscriptions/helpers.js +28 -0
  742. package/subscriptions/index.d.ts +28 -106
  743. package/subscriptions/index.js +40 -17
  744. package/subscriptions/interfaces.d.ts +56 -22
  745. package/subscriptions/interfaces.js +16 -8
  746. package/toolkit/FronteggNativeModule.d.ts +29 -0
  747. package/toolkit/FronteggNativeModule.js +57 -0
  748. package/toolkit/index.d.ts +5 -23
  749. package/toolkit/index.js +3 -128
  750. package/toolkit/proxy.d.ts +1 -0
  751. package/toolkit/proxy.js +9 -0
  752. package/toolkit/store.d.ts +59 -0
  753. package/toolkit/store.js +198 -0
  754. package/vendor/actions.d.ts +12 -0
  755. package/vendor/actions.js +38 -0
  756. package/vendor/index.d.ts +4 -17
  757. package/vendor/index.js +3 -16
  758. package/vendor/interfaces.d.ts +4 -1
  759. package/vendor/state.d.ts +4 -0
  760. package/vendor/state.js +5 -0
  761. package/audits/AuditLogsState/saga.d.ts +0 -2
  762. package/audits/AuditLogsState/saga.js +0 -153
  763. package/audits/AuditsMetadataState/saga.d.ts +0 -2
  764. package/audits/AuditsMetadataState/saga.js +0 -55
  765. package/audits/backward-compatibility/index.d.ts +0 -4
  766. package/audits/backward-compatibility/index.js +0 -4
  767. package/audits/backward-compatibility/initialState.d.ts +0 -2
  768. package/audits/backward-compatibility/initialState.js +0 -20
  769. package/audits/backward-compatibility/interfaces.d.ts +0 -55
  770. package/audits/backward-compatibility/reducer.d.ts +0 -35
  771. package/audits/backward-compatibility/reducer.js +0 -129
  772. package/audits/backward-compatibility/saga.d.ts +0 -1
  773. package/audits/backward-compatibility/saga.js +0 -173
  774. package/audits/initialState.d.ts +0 -2
  775. package/audits/initialState.js +0 -6
  776. package/audits/reducer.d.ts +0 -31
  777. package/audits/reducer.js +0 -21
  778. package/audits/saga.d.ts +0 -2
  779. package/audits/saga.js +0 -9
  780. package/audits/utils.d.ts +0 -14
  781. package/audits/utils.js +0 -13
  782. package/auth/AcceptInvitationState/saga.d.ts +0 -1
  783. package/auth/AcceptInvitationState/saga.js +0 -39
  784. package/auth/AccountSettingsState/saga.d.ts +0 -2
  785. package/auth/AccountSettingsState/saga.js +0 -127
  786. package/auth/ActivateState/index.d.ts +0 -190
  787. package/auth/ActivateState/index.js +0 -46
  788. package/auth/ActivateState/saga.d.ts +0 -1
  789. package/auth/ActivateState/saga.js +0 -191
  790. package/auth/ApiTokensState/saga.d.ts +0 -2
  791. package/auth/ApiTokensState/saga.js +0 -485
  792. package/auth/CustomLoginState/saga.d.ts +0 -20
  793. package/auth/CustomLoginState/saga.js +0 -152
  794. package/auth/CustomLoginState/utils.d.ts +0 -2
  795. package/auth/CustomLoginState/utils.js +0 -11
  796. package/auth/Entitlements/saga.d.ts +0 -30
  797. package/auth/Entitlements/saga.js +0 -51
  798. package/auth/Entitlements/utils.d.ts +0 -23
  799. package/auth/Entitlements/utils.js +0 -71
  800. package/auth/ForgotPasswordState/saga.d.ts +0 -8
  801. package/auth/ForgotPasswordState/saga.js +0 -81
  802. package/auth/GroupsState/groupsDialogsState.d.ts +0 -614
  803. package/auth/GroupsState/groupsDialogsState.js +0 -79
  804. package/auth/GroupsState/saga.d.ts +0 -2
  805. package/auth/GroupsState/saga.js +0 -640
  806. package/auth/Helpers/base64ToFormData.d.ts +0 -1
  807. package/auth/Helpers/base64ToFormData.js +0 -37
  808. package/auth/Helpers/index.d.ts +0 -2
  809. package/auth/Helpers/index.js +0 -2
  810. package/auth/Helpers/isAuthRoute.d.ts +0 -2
  811. package/auth/Helpers/isAuthRoute.js +0 -9
  812. package/auth/ImpersonationState/index.d.ts +0 -117
  813. package/auth/ImpersonationState/index.js +0 -32
  814. package/auth/ImpersonationState/interfaces.d.ts +0 -14
  815. package/auth/ImpersonationState/saga.d.ts +0 -1
  816. package/auth/ImpersonationState/saga.js +0 -37
  817. package/auth/LoginState/mfaRequiredState.saga.d.ts +0 -32
  818. package/auth/LoginState/mfaRequiredState.saga.js +0 -61
  819. package/auth/LoginState/saga.d.ts +0 -35
  820. package/auth/LoginState/saga.js +0 -1967
  821. package/auth/LoginState/utils.d.ts +0 -27
  822. package/auth/LoginState/utils.js +0 -126
  823. package/auth/MSP/AllAccountsState/allAccountsDialogsState.d.ts +0 -767
  824. package/auth/MSP/AllAccountsState/allAccountsDialogsState.js +0 -89
  825. package/auth/MSP/AllAccountsState/index.d.ts +0 -232
  826. package/auth/MSP/AllAccountsState/index.js +0 -101
  827. package/auth/MSP/AllAccountsState/saga.d.ts +0 -3
  828. package/auth/MSP/AllAccountsState/saga.js +0 -825
  829. package/auth/MSP/AllAccountsState/types/dialogsStateTypes.d.ts +0 -49
  830. package/auth/MSP/AllAccountsState/types/stateTypes.d.ts +0 -106
  831. package/auth/MSP/AllAccountsState/types/stateTypes.js +0 -22
  832. package/auth/MSP/AllAccountsState/utils/appendChildrenToNode.d.ts +0 -2
  833. package/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.d.ts +0 -13
  834. package/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.js +0 -19
  835. package/auth/MSP/AllAccountsState/utils/removeNodeFromTree.d.ts +0 -2
  836. package/auth/MSP/AllAccountsState/utils/updateNodeName.d.ts +0 -2
  837. package/auth/MfaState/saga.d.ts +0 -2
  838. package/auth/MfaState/saga.js +0 -673
  839. package/auth/PasskeysState/helpers.d.ts +0 -2
  840. package/auth/PasskeysState/helpers.js +0 -8
  841. package/auth/PasskeysState/saga.d.ts +0 -14
  842. package/auth/PasskeysState/saga.js +0 -56
  843. package/auth/ProfileState/saga.d.ts +0 -2
  844. package/auth/ProfileState/saga.js +0 -178
  845. package/auth/Provisioning/index.d.ts +0 -128
  846. package/auth/Provisioning/index.js +0 -37
  847. package/auth/Provisioning/saga.d.ts +0 -1
  848. package/auth/Provisioning/saga.js +0 -121
  849. package/auth/ResetPhoneNumberState/saga.d.ts +0 -17
  850. package/auth/ResetPhoneNumberState/saga.js +0 -119
  851. package/auth/RolesState/saga.d.ts +0 -2
  852. package/auth/RolesState/saga.js +0 -208
  853. package/auth/SSOState/saga.d.ts +0 -2
  854. package/auth/SSOState/saga.js +0 -478
  855. package/auth/SSOState/saga.v2.d.ts +0 -1
  856. package/auth/SSOState/saga.v2.js +0 -546
  857. package/auth/Security/RestrictionsState/saga.d.ts +0 -2
  858. package/auth/Security/RestrictionsState/saga.js +0 -698
  859. package/auth/Security/SecurityCenterState/saga.d.ts +0 -129
  860. package/auth/Security/SecurityCenterState/saga.js +0 -419
  861. package/auth/Security/SecurityCenterState/types.d.ts +0 -28
  862. package/auth/Security/SecurityCenterState/types.js +0 -10
  863. package/auth/Security/SecurityPolicyState/saga.d.ts +0 -50
  864. package/auth/Security/SecurityPolicyState/saga.js +0 -560
  865. package/auth/Security/SessionsPolicyState/saga.d.ts +0 -2
  866. package/auth/Security/SessionsPolicyState/saga.js +0 -87
  867. package/auth/SessionsState/saga.d.ts +0 -2
  868. package/auth/SessionsState/saga.js +0 -152
  869. package/auth/SignUp/index.d.ts +0 -118
  870. package/auth/SignUp/index.js +0 -36
  871. package/auth/SignUp/saga.d.ts +0 -64
  872. package/auth/SignUp/saga.js +0 -134
  873. package/auth/SocialLogins/index.d.ts +0 -123
  874. package/auth/SocialLogins/index.js +0 -37
  875. package/auth/SocialLogins/saga.d.ts +0 -11
  876. package/auth/SocialLogins/saga.js +0 -152
  877. package/auth/TeamState/saga.d.ts +0 -2
  878. package/auth/TeamState/saga.js +0 -1278
  879. package/auth/TenantsState/saga.d.ts +0 -2
  880. package/auth/TenantsState/saga.js +0 -125
  881. package/auth/dummy.d.ts +0 -45
  882. package/auth/dummy.js +0 -590
  883. package/auth/initialState.d.ts +0 -3
  884. package/auth/initialState.js +0 -66
  885. package/auth/reducer.d.ts +0 -720
  886. package/auth/reducer.js +0 -54
  887. package/auth/saga.d.ts +0 -2
  888. package/auth/saga.js +0 -41
  889. package/auth/utils.d.ts +0 -327
  890. package/auth/utils.js +0 -159
  891. package/connectivity/ConnectivityState/index.d.ts +0 -301
  892. package/connectivity/ConnectivityState/index.js +0 -101
  893. package/connectivity/reducer.d.ts +0 -31
  894. package/connectivity/reducer.js +0 -23
  895. package/connectivity/saga.d.ts +0 -1
  896. package/connectivity/saga.js +0 -562
  897. package/fronteggState.d.ts +0 -28
  898. package/helpers.d.ts +0 -8
  899. package/helpers.js +0 -56
  900. package/node/audits/AuditLogsState/saga.js +0 -161
  901. package/node/audits/AuditsMetadataState/saga.js +0 -62
  902. package/node/audits/backward-compatibility/index.js +0 -49
  903. package/node/audits/backward-compatibility/initialState.js +0 -27
  904. package/node/audits/backward-compatibility/reducer.js +0 -139
  905. package/node/audits/backward-compatibility/saga.js +0 -180
  906. package/node/audits/initialState.js +0 -13
  907. package/node/audits/reducer.js +0 -29
  908. package/node/audits/saga.js +0 -16
  909. package/node/audits/utils.js +0 -21
  910. package/node/auth/AcceptInvitationState/saga.js +0 -45
  911. package/node/auth/AccountSettingsState/saga.js +0 -135
  912. package/node/auth/ActivateState/index.js +0 -53
  913. package/node/auth/ActivateState/saga.js +0 -198
  914. package/node/auth/ApiTokensState/saga.js +0 -493
  915. package/node/auth/CustomLoginState/saga.js +0 -163
  916. package/node/auth/CustomLoginState/utils.js +0 -18
  917. package/node/auth/Entitlements/saga.js +0 -61
  918. package/node/auth/Entitlements/utils.js +0 -80
  919. package/node/auth/ForgotPasswordState/saga.js +0 -89
  920. package/node/auth/GroupsState/groupsDialogsState.js +0 -87
  921. package/node/auth/GroupsState/saga.js +0 -648
  922. package/node/auth/Helpers/base64ToFormData.js +0 -43
  923. package/node/auth/Helpers/index.js +0 -27
  924. package/node/auth/Helpers/isAuthRoute.js +0 -17
  925. package/node/auth/ImpersonationState/index.js +0 -39
  926. package/node/auth/ImpersonationState/saga.js +0 -44
  927. package/node/auth/LoginState/mfaRequiredState.saga.js +0 -68
  928. package/node/auth/LoginState/saga.js +0 -1981
  929. package/node/auth/LoginState/utils.js +0 -142
  930. package/node/auth/MSP/AllAccountsState/allAccountsDialogsState.js +0 -96
  931. package/node/auth/MSP/AllAccountsState/index.js +0 -126
  932. package/node/auth/MSP/AllAccountsState/saga.js +0 -835
  933. package/node/auth/MSP/AllAccountsState/types/stateTypes.js +0 -27
  934. package/node/auth/MSP/AllAccountsState/utils/getAccountsWithUsersCount.js +0 -26
  935. package/node/auth/MfaState/saga.js +0 -681
  936. package/node/auth/PasskeysState/helpers.js +0 -15
  937. package/node/auth/PasskeysState/saga.js +0 -64
  938. package/node/auth/ProfileState/saga.js +0 -186
  939. package/node/auth/Provisioning/index.js +0 -44
  940. package/node/auth/Provisioning/saga.js +0 -128
  941. package/node/auth/ResetPhoneNumberState/saga.js +0 -127
  942. package/node/auth/RolesState/saga.js +0 -216
  943. package/node/auth/SSOState/saga.js +0 -486
  944. package/node/auth/SSOState/saga.v2.js +0 -553
  945. package/node/auth/Security/RestrictionsState/saga.js +0 -706
  946. package/node/auth/Security/SecurityCenterState/saga.js +0 -441
  947. package/node/auth/Security/SecurityCenterState/types.js +0 -17
  948. package/node/auth/Security/SecurityPolicyState/saga.js +0 -574
  949. package/node/auth/Security/SessionsPolicyState/saga.js +0 -95
  950. package/node/auth/SessionsState/saga.js +0 -159
  951. package/node/auth/SignUp/index.js +0 -43
  952. package/node/auth/SignUp/saga.js +0 -144
  953. package/node/auth/SocialLogins/index.js +0 -44
  954. package/node/auth/SocialLogins/saga.js +0 -161
  955. package/node/auth/TeamState/saga.js +0 -1286
  956. package/node/auth/TenantsState/saga.js +0 -132
  957. package/node/auth/dummy.js +0 -633
  958. package/node/auth/initialState.js +0 -75
  959. package/node/auth/reducer.js +0 -62
  960. package/node/auth/saga.js +0 -48
  961. package/node/auth/utils.js +0 -178
  962. package/node/connectivity/ConnectivityState/index.js +0 -108
  963. package/node/connectivity/reducer.js +0 -32
  964. package/node/connectivity/saga.js +0 -567
  965. package/node/helpers.js +0 -70
  966. package/node/subscriptions/Billing/Information/saga.js +0 -122
  967. package/node/subscriptions/Billing/Invoices/saga.js +0 -85
  968. package/node/subscriptions/Billing/PaymentMethod/saga.js +0 -87
  969. package/node/subscriptions/Billing/Subscription/loadSubscription.saga.js +0 -26
  970. package/node/subscriptions/Billing/Subscription/saga.js +0 -101
  971. package/node/subscriptions/Billing/saga.js +0 -18
  972. package/node/subscriptions/Checkout/saga.js +0 -116
  973. package/node/subscriptions/Config/saga.js +0 -65
  974. package/node/subscriptions/Plans/saga.js +0 -66
  975. package/node/subscriptions/Stripe/saga.js +0 -37
  976. package/node/subscriptions/VendorPublicConfig/saga.js +0 -45
  977. package/node/subscriptions/general.interfaces.js +0 -25
  978. package/node/subscriptions/mapper.js +0 -40
  979. package/node/subscriptions/reducer.js +0 -48
  980. package/node/subscriptions/saga.js +0 -20
  981. package/node/subscriptions/utils.js +0 -62
  982. package/node/toolkit/redux-saga-tools.js +0 -56
  983. package/node/toolkit/redux.js +0 -42
  984. package/node/utils/gtm.js +0 -29
  985. package/node/utils/index.js +0 -38
  986. package/node/vendor/VendorState/index.js +0 -31
  987. package/node/vendor/reducer.js +0 -26
  988. package/node/vendor/saga.js +0 -52
  989. package/subscriptions/Billing/Information/saga.d.ts +0 -34
  990. package/subscriptions/Billing/Information/saga.js +0 -111
  991. package/subscriptions/Billing/Invoices/saga.d.ts +0 -13
  992. package/subscriptions/Billing/Invoices/saga.js +0 -76
  993. package/subscriptions/Billing/PaymentMethod/saga.d.ts +0 -13
  994. package/subscriptions/Billing/PaymentMethod/saga.js +0 -78
  995. package/subscriptions/Billing/Subscription/loadSubscription.saga.d.ts +0 -1
  996. package/subscriptions/Billing/Subscription/loadSubscription.saga.js +0 -21
  997. package/subscriptions/Billing/Subscription/saga.d.ts +0 -2
  998. package/subscriptions/Billing/Subscription/saga.js +0 -94
  999. package/subscriptions/Billing/saga.d.ts +0 -2
  1000. package/subscriptions/Billing/saga.js +0 -11
  1001. package/subscriptions/Checkout/saga.d.ts +0 -5
  1002. package/subscriptions/Checkout/saga.js +0 -108
  1003. package/subscriptions/Config/saga.d.ts +0 -2
  1004. package/subscriptions/Config/saga.js +0 -58
  1005. package/subscriptions/Plans/saga.d.ts +0 -2
  1006. package/subscriptions/Plans/saga.js +0 -58
  1007. package/subscriptions/Stripe/saga.d.ts +0 -1
  1008. package/subscriptions/Stripe/saga.js +0 -31
  1009. package/subscriptions/VendorPublicConfig/saga.d.ts +0 -2
  1010. package/subscriptions/VendorPublicConfig/saga.js +0 -38
  1011. package/subscriptions/general.interfaces.d.ts +0 -49
  1012. package/subscriptions/general.interfaces.js +0 -16
  1013. package/subscriptions/mapper.d.ts +0 -6
  1014. package/subscriptions/mapper.js +0 -31
  1015. package/subscriptions/reducer.d.ts +0 -99
  1016. package/subscriptions/reducer.js +0 -33
  1017. package/subscriptions/saga.d.ts +0 -2
  1018. package/subscriptions/saga.js +0 -13
  1019. package/subscriptions/utils.d.ts +0 -68
  1020. package/subscriptions/utils.js +0 -52
  1021. package/toolkit/interfaces.d.ts +0 -7
  1022. package/toolkit/redux-saga-tools.d.ts +0 -4
  1023. package/toolkit/redux-saga-tools.js +0 -3
  1024. package/toolkit/redux-types.d.ts +0 -3
  1025. package/toolkit/redux.d.ts +0 -4
  1026. package/toolkit/redux.js +0 -1
  1027. package/utils/gtm.d.ts +0 -28
  1028. package/utils/gtm.js +0 -22
  1029. package/utils/index.d.ts +0 -3
  1030. package/utils/index.js +0 -3
  1031. package/utils/package.json +0 -6
  1032. package/utils/sha256.d.ts +0 -22
  1033. package/utils/sha256.js +0 -425
  1034. package/vendor/VendorState/index.d.ts +0 -21
  1035. package/vendor/VendorState/index.js +0 -24
  1036. package/vendor/reducer.d.ts +0 -8
  1037. package/vendor/reducer.js +0 -17
  1038. package/vendor/saga.d.ts +0 -8
  1039. package/vendor/saga.js +0 -44
  1040. /package/{audits/backward-compatibility → audits-backward-compatibility}/interfaces.js +0 -0
  1041. /package/auth/{ActivateState → ActivateAccountState}/interfaces.d.ts +0 -0
  1042. /package/auth/{ActivateState → ActivateAccountState}/interfaces.js +0 -0
  1043. /package/auth/{Provisioning → ApplicationsState}/interfaces.js +0 -0
  1044. /package/auth/{SocialLogins → GroupsDialogsState}/interfaces.js +0 -0
  1045. /package/auth/{ImpersonationState → ImpersonateState}/interfaces.js +0 -0
  1046. /package/auth/MSP/{AllAccountsState/utils → helpers}/appendChildrenToNode.js +0 -0
  1047. /package/auth/MSP/{AllAccountsState/utils → helpers}/removeNodeFromTree.js +0 -0
  1048. /package/auth/MSP/{AllAccountsState/utils → helpers}/updateNodeName.js +0 -0
  1049. /package/auth/MSP/{AllAccountsState/types → interfaces}/dialogsStateTypes.js +0 -0
  1050. /package/auth/MSP/{AllAccountsState/types → interfaces}/index.d.ts +0 -0
  1051. /package/auth/MSP/{AllAccountsState/types → interfaces}/index.js +0 -0
  1052. /package/auth/{Provisioning → ProvisioningState}/interfaces.d.ts +0 -0
  1053. /package/{toolkit → auth/ProvisioningState}/interfaces.js +0 -0
  1054. /package/auth/{SignUp → SignUpState}/interfaces.d.ts +0 -0
  1055. /package/auth/{SignUp → SignUpState}/interfaces.js +0 -0
  1056. /package/{fronteggState.js → auth/SmsState/interfaces.js} +0 -0
  1057. /package/auth/{SocialLogins → SocialLoginState}/interfaces.d.ts +0 -0
  1058. /package/{toolkit/redux-types.js → auth/SocialLoginState/interfaces.js} +0 -0
  1059. /package/{utils/errorHandler.d.ts → helpers/handlers.d.ts} +0 -0
  1060. /package/{utils/errorHandler.js → helpers/handlers.js} +0 -0
  1061. /package/{audits → mocks/audits-mocks}/dummy.d.ts +0 -0
  1062. /package/{audits → mocks/audits-mocks}/dummy.js +0 -0
  1063. /package/{subscriptions → mocks/subscriptions-mocks}/dummy.d.ts +0 -0
  1064. /package/{subscriptions → mocks/subscriptions-mocks}/dummy.js +0 -0
  1065. /package/node/{audits/backward-compatibility → audits-backward-compatibility}/interfaces.js +0 -0
  1066. /package/node/auth/{ActivateState → ActivateAccountState}/interfaces.js +0 -0
  1067. /package/node/auth/{Provisioning → ApplicationsState}/interfaces.js +0 -0
  1068. /package/node/auth/{SocialLogins → GroupsDialogsState}/interfaces.js +0 -0
  1069. /package/node/auth/{ImpersonationState → ImpersonateState}/interfaces.js +0 -0
  1070. /package/node/auth/MSP/{AllAccountsState/utils → helpers}/appendChildrenToNode.js +0 -0
  1071. /package/node/auth/MSP/{AllAccountsState/utils → helpers}/removeNodeFromTree.js +0 -0
  1072. /package/node/auth/MSP/{AllAccountsState/utils → helpers}/updateNodeName.js +0 -0
  1073. /package/node/auth/MSP/{AllAccountsState/types → interfaces}/dialogsStateTypes.js +0 -0
  1074. /package/node/auth/MSP/{AllAccountsState/types → interfaces}/index.js +0 -0
  1075. /package/node/{toolkit → auth/ProvisioningState}/interfaces.js +0 -0
  1076. /package/node/auth/{SignUp → SignUpState}/interfaces.js +0 -0
  1077. /package/node/{fronteggState.js → auth/SmsState/interfaces.js} +0 -0
  1078. /package/node/{toolkit/redux-types.js → auth/SocialLoginState/interfaces.js} +0 -0
  1079. /package/node/{utils/errorHandler.js → helpers/handlers.js} +0 -0
  1080. /package/node/{utils → helpers}/sha256.js +0 -0
  1081. /package/node/{audits → mocks/audits-mocks}/dummy.js +0 -0
  1082. /package/node/{subscriptions → mocks/subscriptions-mocks}/dummy.js +0 -0
@@ -1,1967 +0,0 @@
1
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["callback"],
4
- _excluded2 = ["callback"],
5
- _excluded3 = ["callback"],
6
- _excluded4 = ["callback"],
7
- _excluded5 = ["callback", "events"],
8
- _excluded6 = ["callback"],
9
- _excluded7 = ["callback"],
10
- _excluded8 = ["callback"],
11
- _excluded9 = ["callback"],
12
- _excluded10 = ["user"],
13
- _excluded11 = ["callback"],
14
- _excluded12 = ["callback"],
15
- _excluded13 = ["callback"],
16
- _excluded14 = ["callback"],
17
- _excluded15 = ["callback"],
18
- _excluded16 = ["callback", "deviceId"],
19
- _excluded17 = ["callback"],
20
- _excluded18 = ["callback"],
21
- _excluded19 = ["callback", "deviceId"],
22
- _excluded20 = ["callback", "deviceId"],
23
- _excluded21 = ["callback", "deviceId"];
24
- import { all, call, put, select, takeLeading } from 'redux-saga/effects';
25
- import { api, AuthStrategyEnum, ContextHolder, fetch, WebAuthnDeviceType } from '@frontegg/rest-api';
26
- import { actions } from '../reducer';
27
- import { FRONTEGG_AFTER_AUTH_REDIRECT_URL, HOSTED_LOGIN_VERIFIER_KEY } from '../../constants';
28
- import { UserVeirifedOriginTypes } from '../interfaces';
29
- import { LoginFlow, LoginStep } from './interfaces';
30
- import { getMfaRequiredState } from './mfaRequiredState.saga';
31
- import { loadAllowSignUps } from '../SignUp/saga';
32
- import { MFAStep } from '../MfaState/interfaces';
33
- import { dummyIps, userDemo } from '../dummy';
34
- import { SamlVendors } from '../SSOState/interfaces';
35
- import { loadVendorPublicInfo } from '../../vendor/saga';
36
- import { createRandomString, generateCodeChallenge, getFeatureFlags } from '../../helpers';
37
- import { ResetPhoneNumberStep } from '../ResetPhoneNumberState/interfaces';
38
- import { base64urlDecode, delay, publicKeyCredentialToJSON } from '../utils';
39
- import { loadPublicAuthStrategiesPolicy } from '../Security/SecurityPolicyState/saga';
40
- import { getPasskeysVendorPolicy } from '../PasskeysState/helpers';
41
- import { getPathAndSearchParamsFromUrl, getRedirectUrl, getSearchParam, TENANT_ID_PARAM_KEY, isMfaRequired, isOauthCallbackRoute } from './utils';
42
- import { errorHandler, GTMEventAction, reportGTMEvent } from '../../utils';
43
- import { authStrategyLoginStepMap } from './consts';
44
- import { isEntitlementsDeeplyEqual } from '../Entitlements';
45
- import { customLoginEnabled, loadCustomLoginRoutes } from '../CustomLoginState/saga';
46
-
47
- /**
48
- * Prevent unnecessary entitlements reference update inside the user object by
49
- * deep equality with the stored user.entitlements
50
- * This function should not be used for first login because no stored entitlements.
51
- * @param updatedUser new user response from the BE
52
- * @returns final user object with the correct entitlements reference
53
- */
54
- function* handleUnnecessaryEntitlementsUpdate(updatedUser) {
55
- const oldEntitlements = yield select(state => {
56
- var _state$auth$user;
57
- return (_state$auth$user = state.auth.user) == null ? void 0 : _state$auth$user.entitlements;
58
- });
59
- if (isEntitlementsDeeplyEqual(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
60
- // set the previous entitlemenets object
61
- return _extends({}, updatedUser, {
62
- entitlements: oldEntitlements
63
- });
64
- }
65
- return updatedUser;
66
- }
67
- export function* afterAuthenticationStateUpdate({
68
- user,
69
- tenants = [],
70
- activeTenant
71
- }, additionalUpdate = {}) {
72
- const {
73
- tenantsState: currentTenantsState
74
- } = yield select(state => state.auth);
75
- yield put(actions.setState(_extends({
76
- user,
77
- tenantsState: _extends({}, currentTenantsState, {
78
- tenants,
79
- activeTenant,
80
- loading: false
81
- })
82
- }, additionalUpdate)));
83
- }
84
- export function* afterAuthNavigation() {
85
- const onRedirectTo = ContextHolder.onRedirectTo;
86
- const {
87
- routes,
88
- includeQueryParam,
89
- enforceRedirectToSameSite = false,
90
- allowedRedirectOrigins = []
91
- } = yield select(state => state.auth);
92
- const {
93
- loginUrl,
94
- logoutUrl,
95
- socialLoginCallbackUrl,
96
- activateUrl
97
- } = routes;
98
- let {
99
- authenticatedUrl,
100
- customLoginAuthenticatedUrl
101
- } = routes;
102
- if (!customLoginAuthenticatedUrl) {
103
- yield call(loadCustomLoginRoutes);
104
- customLoginAuthenticatedUrl = yield select(state => {
105
- var _state$auth$routes;
106
- return (_state$auth$routes = state.auth.routes) == null ? void 0 : _state$auth$routes.customLoginAuthenticatedUrl;
107
- });
108
- }
109
- const afterAuthRedirect = window.localStorage.getItem(FRONTEGG_AFTER_AUTH_REDIRECT_URL);
110
- if (afterAuthRedirect && ![loginUrl, logoutUrl, socialLoginCallbackUrl, activateUrl].includes(afterAuthRedirect)) {
111
- authenticatedUrl = afterAuthRedirect;
112
- }
113
- window.localStorage.removeItem(FRONTEGG_AFTER_AUTH_REDIRECT_URL);
114
- yield delay(200);
115
- put(actions.resetLoginState());
116
- const redirectUrl = getRedirectUrl({
117
- authenticatedUrl: customLoginAuthenticatedUrl ? getPathAndSearchParamsFromUrl(customLoginAuthenticatedUrl) : authenticatedUrl,
118
- includeQueryParam,
119
- enforceRedirectToSameSite,
120
- allowedRedirectOrigins
121
- });
122
- onRedirectTo(redirectUrl, {
123
- refresh: redirectUrl.startsWith('http')
124
- });
125
- }
126
- export function* refreshMetadata() {
127
- let ssoACS;
128
- try {
129
- var _metadata$configurati;
130
- const metadata = yield call(api.metadata.getSamlMetadata);
131
- ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
132
- } catch (e) {
133
- console.error(e);
134
- }
135
- yield put(actions.setState({
136
- ssoACS
137
- }));
138
- }
139
- export function* loadSSOPublicConfigurationFunction() {
140
- try {
141
- const {
142
- isActive
143
- } = yield call(api.auth.getSSOPublicConfiguration);
144
- yield put(actions.setState({
145
- isSSOAuth: isActive
146
- }));
147
- } catch (e) {
148
- console.error(e);
149
- }
150
- }
151
- function* shouldNevigateToRegisterQuickLogin(user) {
152
- var _ref;
153
- const {
154
- routes,
155
- loginState
156
- } = yield select(state => state.auth);
157
- const quickLoginToRegister = (_ref = localStorage.getItem('register-quick-login')) != null ? _ref : loginState.quickLoginToRegister;
158
- return quickLoginToRegister && localStorage.getItem(`${user.id}-${quickLoginToRegister}`) !== 'true' && !window.location.pathname.endsWith(routes.logoutUrl);
159
- }
160
- export function* refreshToken() {
161
- const {
162
- hostedLoginBox
163
- } = yield select(state => state.auth);
164
- if (hostedLoginBox) {
165
- yield call(refreshTokenHosted);
166
- } else {
167
- yield call(refreshTokenEmbedded);
168
- }
169
- }
170
- export function* refreshTokenForSocialLogins() {
171
- const {
172
- hostedLoginBox
173
- } = yield select(state => state.auth);
174
- if (hostedLoginBox) {
175
- yield call(refreshTokenHostedSocialLogins);
176
- } else {
177
- yield call(refreshTokenEmbeddedSocialLogins);
178
- }
179
- }
180
- function* refreshTokenHosted() {
181
- const {
182
- user
183
- } = yield select(state => state.auth);
184
- if (!(user != null && user.refreshToken)) {
185
- ContextHolder.setAccessToken(null);
186
- ContextHolder.setUser(null);
187
- yield put(actions.setState({
188
- user: null,
189
- isAuthenticated: false
190
- }));
191
- return;
192
- }
193
- try {
194
- const body = {
195
- grant_type: 'refresh_token',
196
- refresh_token: user == null ? void 0 : user.refreshToken
197
- };
198
- const response = yield call(api.auth.exchangeOAuthTokensV2, body);
199
- const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, response.user);
200
- yield call(afterAuthenticationStateUpdate, _extends({}, response, {
201
- user: updatedUser
202
- }), {
203
- isAuthenticated: true
204
- });
205
- } catch (e) {
206
- ContextHolder.setAccessToken(null);
207
- ContextHolder.setUser(null);
208
- yield put(actions.setState({
209
- user: null,
210
- isAuthenticated: false
211
- }));
212
- }
213
- }
214
- function* refreshTokenHostedSocialLogins() {
215
- const {
216
- user: currentUser
217
- } = yield select(state => state.auth);
218
- if (!(currentUser != null && currentUser.refreshToken)) {
219
- ContextHolder.setAccessToken(null);
220
- ContextHolder.setUser(null);
221
- yield put(actions.setState({
222
- user: null,
223
- isAuthenticated: false
224
- }));
225
- return;
226
- }
227
- try {
228
- const body = {
229
- grant_type: 'refresh_token',
230
- refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
231
- };
232
- const response = yield call(api.auth.exchangeOAuthTokensV2, body);
233
- const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, response.user);
234
- yield call(afterAuthenticationStateUpdate, _extends({}, response, {
235
- user: updatedUser
236
- }), {
237
- isAuthenticated: true
238
- });
239
- } catch (e) {
240
- ContextHolder.setAccessToken(null);
241
- ContextHolder.setUser(null);
242
- yield put(actions.setState({
243
- user: null,
244
- isAuthenticated: false
245
- }));
246
- }
247
- }
248
- function* refreshTokenEmbedded() {
249
- try {
250
- const onRedirectTo = ContextHolder.onRedirectTo;
251
- const {
252
- routes,
253
- loginState
254
- } = yield select(state => state.auth);
255
- const {
256
- user,
257
- tenants = [],
258
- activeTenant
259
- } = yield call(api.auth.refreshTokenV3);
260
- if (isMfaRequired(user)) {
261
- const mfaRequiredState = yield getMfaRequiredState(user);
262
- yield put(actions.setState(mfaRequiredState));
263
- onRedirectTo(routes.loginUrl, {
264
- preserveQueryParams: true
265
- });
266
- } else {
267
- var _ref2;
268
- if (user.id) {
269
- localStorage.setItem('userId', user.id);
270
- }
271
- const quickLoginToRegister = (_ref2 = localStorage.getItem('register-quick-login')) != null ? _ref2 : loginState.quickLoginToRegister;
272
- const shouldNavigateToRegisterQuickLogin = yield shouldNevigateToRegisterQuickLogin(user);
273
- const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, user);
274
- yield call(afterAuthenticationStateUpdate, {
275
- user: updatedUser,
276
- tenants,
277
- activeTenant
278
- }, {
279
- loginState: _extends({}, loginState, {
280
- quickLoginToRegister,
281
- flow: shouldNavigateToRegisterQuickLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login
282
- }),
283
- isAuthenticated: true
284
- });
285
- yield handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
286
- }
287
- } catch (e) {
288
- ContextHolder.setAccessToken(null);
289
- ContextHolder.setUser(null);
290
- yield put(actions.setState({
291
- user: undefined,
292
- isAuthenticated: false
293
- }));
294
- }
295
- }
296
- function* refreshTokenEmbeddedSocialLogins() {
297
- try {
298
- const onRedirectTo = ContextHolder.onRedirectTo;
299
- const {
300
- routes,
301
- loginState
302
- } = yield select(state => state.auth);
303
- const {
304
- user,
305
- tenants = [],
306
- activeTenant
307
- } = yield call(api.auth.refreshTokenV3);
308
- if (isMfaRequired(user)) {
309
- const mfaRequiredState = yield getMfaRequiredState(user);
310
- yield put(actions.setState(mfaRequiredState));
311
- onRedirectTo(routes.loginUrl, {
312
- preserveQueryParams: true
313
- });
314
- } else {
315
- const updatedUser = yield call(handleUnnecessaryEntitlementsUpdate, user);
316
- const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
317
- if (shouldShowPrompt) {
318
- yield put(actions.setLoginState({
319
- step: LoginStep.promptPasskeys,
320
- loading: false
321
- }));
322
- yield call(afterAuthenticationStateUpdate, {
323
- user: updatedUser,
324
- tenants,
325
- activeTenant
326
- }, {
327
- isLoading: false
328
- });
329
- onRedirectTo(routes.loginUrl, {
330
- preserveQueryParams: true
331
- });
332
- } else {
333
- var _ref3;
334
- if (user.id) {
335
- localStorage.setItem('userId', user.id);
336
- }
337
- const quickLoginToRegister = (_ref3 = localStorage.getItem('register-quick-login')) != null ? _ref3 : loginState.quickLoginToRegister;
338
- const shouldNavigateToRegisterQuickLogin = yield shouldNevigateToRegisterQuickLogin(user);
339
- yield call(afterAuthenticationStateUpdate, {
340
- user: updatedUser,
341
- tenants,
342
- activeTenant
343
- }, {
344
- loginState: _extends({}, loginState, {
345
- quickLoginToRegister,
346
- flow: shouldNavigateToRegisterQuickLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login
347
- }),
348
- isAuthenticated: true
349
- });
350
- yield handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin);
351
- }
352
- }
353
- } catch (e) {
354
- ContextHolder.setAccessToken(null);
355
- ContextHolder.setUser(null);
356
- yield put(actions.setState({
357
- user: undefined,
358
- isAuthenticated: false
359
- }));
360
- }
361
- }
362
- function* handleRedirectRefreshToken(shouldNavigateToRegisterQuickLogin) {
363
- var _window;
364
- const url = new URL((_window = window) == null ? void 0 : _window.location.href);
365
- const onRedirectTo = ContextHolder.onRedirectTo;
366
- const {
367
- routes,
368
- loginState
369
- } = yield select(state => state.auth);
370
- const invitationToken = url.searchParams.get('invitationToken');
371
- const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl];
372
- if (!invitationToken) {
373
- redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
374
- }
375
- if (shouldNavigateToRegisterQuickLogin) {
376
- onRedirectTo(routes.loginUrl);
377
- } else if (redirectRoutes.some(url => url && window.location.pathname.endsWith(url))) {
378
- if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
379
- onRedirectTo(routes.signUpSuccessUrl, {
380
- refresh: routes.signUpSuccessUrl.startsWith('http')
381
- });
382
- } else {
383
- yield afterAuthNavigation();
384
- }
385
- }
386
- }
387
- function* getUserIP({
388
- payload: {
389
- callback
390
- }
391
- }) {
392
- try {
393
- const {
394
- ip
395
- } = yield call(api.metadata.getCurrentUserIpMetadata);
396
- yield put(actions.setState({
397
- userIp: ip
398
- }));
399
- callback == null ? void 0 : callback(true);
400
- } catch (e) {
401
- callback == null ? void 0 : callback(false);
402
- }
403
- }
404
- function* requestAuthorize({
405
- payload: firstTime
406
- }) {
407
- const calls = [];
408
- const isCustomLoginEnabled = yield call(customLoginEnabled);
409
- if (isCustomLoginEnabled) {
410
- /*
411
- // waiting for refreshToken to be loaded is only necessary for custom login
412
- // but doing this will degrade the loading performance in around 500 ms
413
- // so we will wait for the refreshToken only if there is tenantResolver
414
- */
415
- yield call(refreshToken);
416
- } else {
417
- calls.push(call(refreshToken));
418
- }
419
- if (firstTime) {
420
- yield put(actions.setState({
421
- isLoading: true
422
- }));
423
- yield put(actions.loadSocialLoginsConfigurationV2());
424
- calls.push(call(loadAllowSignUps));
425
- calls.push(call(loadPublicAuthStrategiesPolicy));
426
- calls.push(call(loadSSOPublicConfigurationFunction));
427
- calls.push(call(loadVendorPublicInfo));
428
- calls.push(call(refreshMetadata));
429
- calls.push(call(loadCustomLoginRoutes));
430
- }
431
- yield all(calls);
432
- yield put(actions.setState({
433
- isLoading: false
434
- }));
435
- }
436
- function* isMFARequiredSSR({
437
- accessToken,
438
- user
439
- }) {
440
- if (!accessToken) {
441
- yield put(actions.setState({
442
- user: undefined,
443
- isAuthenticated: false
444
- }));
445
- return;
446
- }
447
- const onRedirectTo = ContextHolder.onRedirectTo;
448
- const {
449
- routes
450
- } = yield select(state => state.auth);
451
- if (isMfaRequired(user)) {
452
- const mfaRequiredState = yield getMfaRequiredState(user);
453
- yield put(actions.setState(mfaRequiredState));
454
- onRedirectTo(routes.loginUrl, {
455
- preserveQueryParams: true
456
- });
457
- }
458
- }
459
- function* requestAuthorizeSSR({
460
- payload
461
- }) {
462
- const calls = [];
463
- yield put(actions.loadSocialLoginsConfigurationV2());
464
- calls.push(call(loadAllowSignUps));
465
- calls.push(call(loadSSOPublicConfigurationFunction));
466
- calls.push(call(loadVendorPublicInfo));
467
- calls.push(call(refreshMetadata));
468
- calls.push(call(isMFARequiredSSR, payload));
469
- calls.push(call(loadCustomLoginRoutes));
470
- yield all(calls);
471
- }
472
- const getUri = urlStrategy => {
473
- if (urlStrategy === 'path') {
474
- var _window2;
475
- return ((_window2 = window) != null ? _window2 : document).location.pathname;
476
- } else {
477
- var _window3;
478
- const uri = (((_window3 = window) != null ? _window3 : document).location.hash || '#').substring(1);
479
- if (uri.indexOf('?') !== -1) {
480
- return uri.substring(0, uri.indexOf('?'));
481
- } else {
482
- return uri;
483
- }
484
- }
485
- };
486
- function* requestHostedLoginSilentAuthorize() {
487
- const response = yield call(api.auth.silentOAuthRefreshTokenV2);
488
- if (response != null && response.user) {
489
- yield call(afterAuthenticationStateUpdate, response, {
490
- isAuthenticated: true,
491
- isLoading: false
492
- });
493
- } else {
494
- throw new Error(`couldn't refresh user token with oauth service`);
495
- }
496
- }
497
- function* refreshOrRequestHostedLoginAuthorize({
498
- payload: additionalParams
499
- }) {
500
- const {
501
- disableSilentRefresh
502
- } = yield select(state => ({
503
- disableSilentRefresh: state.auth.disableSilentRefresh
504
- }));
505
- try {
506
- if (disableSilentRefresh) {
507
- throw new Error('silent refresh is disabled');
508
- }
509
- yield requestHostedLoginSilentAuthorize();
510
- } catch (e) {
511
- yield requestHostedLoginAuthorize(additionalParams);
512
- }
513
- }
514
- function* refreshOrRequestHostedLoginAuthorizeV2({
515
- payload: {
516
- additionalParams,
517
- shouldRedirectToLogin,
518
- firstTime
519
- }
520
- }) {
521
- if (firstTime) {
522
- const {
523
- urlStrategy
524
- } = yield select(state => ({
525
- urlStrategy: state.root.urlStrategy
526
- }));
527
- const activeUri = getUri(urlStrategy);
528
- yield put(actions.setState({
529
- isLoading: true
530
- }));
531
- if (isOauthCallbackRoute(activeUri)) {
532
- return;
533
- }
534
- }
535
- const {
536
- disableSilentRefresh
537
- } = yield select(state => ({
538
- disableSilentRefresh: state.auth.disableSilentRefresh
539
- }));
540
- try {
541
- if (disableSilentRefresh) {
542
- throw new Error('silent refresh is disabled');
543
- }
544
- yield requestHostedLoginSilentAuthorize();
545
- } catch (e) {
546
- if (!shouldRedirectToLogin) {
547
- yield put(actions.setState({
548
- isLoading: false
549
- }));
550
- return;
551
- }
552
- yield requestHostedLoginAuthorize(additionalParams);
553
- }
554
- }
555
- function* requestHostedLoginAuthorize(additionalParams) {
556
- const {
557
- routes,
558
- context,
559
- onRedirectTo,
560
- urlStrategy
561
- } = yield select(state => ({
562
- routes: state.auth.routes,
563
- onRedirectTo: state.auth.onRedirectTo,
564
- context: state.root.context,
565
- urlStrategy: state.root.urlStrategy
566
- }));
567
- const activeUri = getUri(urlStrategy);
568
- if (activeUri === routes.hostedLoginRedirectUrl) {
569
- console.debug('Calling loginWithRedirect while in hostedLoginCallback route');
570
- return;
571
- }
572
- yield put(actions.setState({
573
- isLoading: true
574
- }));
575
- // Generate the relevant params for the redirect
576
- const nonce = createRandomString();
577
- const code_verifier = createRandomString();
578
- const code_challenge = yield call(generateCodeChallenge, code_verifier);
579
-
580
- // We are saving the verifier in session storage to be able to validate the response
581
- localStorage.setItem(HOSTED_LOGIN_VERIFIER_KEY, code_verifier);
582
- let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
583
- yield call(loadCustomLoginRoutes);
584
- const customLoginSearchParam = yield select(state => {
585
- var _state$auth$customLog;
586
- return (_state$auth$customLog = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog.customLoginSearchParams;
587
- });
588
- if (customLoginSearchParam) {
589
- if (redirectUrl.endsWith('/')) {
590
- redirectUrl = redirectUrl.slice(0, -1);
591
- }
592
- redirectUrl += customLoginSearchParam;
593
- }
594
- const baseUrl = fetch.getBaseUrl(context, '/oauth/authorize');
595
- // Hard coded for now
596
- const oauthUrl = `${baseUrl}/oauth/authorize`;
597
- const params = _extends({
598
- response_type: 'code',
599
- client_id: context.clientId || 'INVALID-CLIENT-ID',
600
- scope: 'openid email profile',
601
- redirect_uri: redirectUrl,
602
- code_challenge: code_challenge,
603
- code_challenge_method: 'S256',
604
- nonce
605
- }, additionalParams);
606
- if (context.tenantResolver) {
607
- var _context$tenantResolv;
608
- const resolvedTenantResult = yield (_context$tenantResolv = context.tenantResolver) == null ? void 0 : _context$tenantResolv.call(context);
609
- if (resolvedTenantResult != null && resolvedTenantResult.tenant) {
610
- params['organization'] = resolvedTenantResult.tenant;
611
- }
612
- }
613
- const tenantId = getSearchParam(TENANT_ID_PARAM_KEY);
614
- if (tenantId) {
615
- params['tenantId'] = tenantId;
616
- }
617
- const searchParams = new URLSearchParams(params);
618
- const url = `${oauthUrl}?${searchParams.toString()}`;
619
- onRedirectTo(url, {
620
- refresh: true
621
- });
622
- }
623
- function* handleHostedLoginCallback({
624
- payload
625
- }) {
626
- // Hard coded for now
627
- const code_verifier = localStorage.getItem(HOSTED_LOGIN_VERIFIER_KEY) || 'INVALID-CODE-VERIFIER';
628
- const {
629
- routes,
630
- urlStrategy
631
- } = yield select(state => ({
632
- routes: state.auth.routes,
633
- urlStrategy: state.root.urlStrategy
634
- }));
635
- let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${routes.hostedLoginRedirectUrl}`;
636
- yield call(loadCustomLoginRoutes);
637
- const customLoginSearchParam = yield select(state => {
638
- var _state$auth$customLog2;
639
- return (_state$auth$customLog2 = state.auth.customLoginState) == null ? void 0 : _state$auth$customLog2.customLoginSearchParams;
640
- });
641
- if (customLoginSearchParam) {
642
- if (redirectUrl.endsWith('/')) {
643
- redirectUrl = redirectUrl.slice(0, -1);
644
- }
645
- redirectUrl += customLoginSearchParam;
646
- }
647
- const body = {
648
- code: payload.code,
649
- redirect_uri: redirectUrl,
650
- code_verifier,
651
- grant_type: 'authorization_code'
652
- };
653
- try {
654
- const response = yield call(api.auth.exchangeOAuthTokensV2, body);
655
- yield call(afterAuthenticationStateUpdate, response, {
656
- isAuthenticated: true,
657
- isLoading: false
658
- });
659
- } catch (e) {
660
- yield put(actions.setState({
661
- isLoading: false
662
- }));
663
- console.error('Failed to exchangeOAuthTokens', e);
664
- } finally {
665
- yield afterAuthNavigation();
666
- }
667
- }
668
- function* changePhoneNumberWithVerification(_ref4) {
669
- let {
670
- payload: {
671
- callback
672
- }
673
- } = _ref4,
674
- payload = _objectWithoutPropertiesLoose(_ref4.payload, _excluded);
675
- try {
676
- yield put(actions.setLoginState({
677
- loading: true
678
- }));
679
- const changePhoneRes = yield call(api.auth.changePhoneNumberWithVerification, payload);
680
- yield put(actions.setLoginState({
681
- phoneNumber: payload.phoneNumber,
682
- loading: false,
683
- changePhoneId: changePhoneRes.changePhoneId,
684
- step: LoginStep.loginWithQuickSmsOtc,
685
- error: undefined
686
- }));
687
- callback == null ? void 0 : callback(true);
688
- } catch (e) {
689
- yield put(actions.setLoginState({
690
- error: errorHandler(e),
691
- loading: false
692
- }));
693
- }
694
- }
695
- function* verifyChangePhoneNumber(_ref5) {
696
- let {
697
- payload: {
698
- callback
699
- }
700
- } = _ref5,
701
- payload = _objectWithoutPropertiesLoose(_ref5.payload, _excluded2);
702
- try {
703
- yield put(actions.setLoginState({
704
- loading: true
705
- }));
706
- yield call(api.auth.verifyChangePhoneNumber, payload);
707
- yield put(actions.setLoginState({
708
- loading: false
709
- }));
710
- callback == null ? void 0 : callback(true);
711
- } catch (e) {
712
- yield put(actions.setLoginState({
713
- error: errorHandler(e),
714
- loading: false
715
- }));
716
- }
717
- }
718
- function* quickSmsPasswordlessPreLogin(_ref6) {
719
- let {
720
- payload: {
721
- callback
722
- }
723
- } = _ref6,
724
- payload = _objectWithoutPropertiesLoose(_ref6.payload, _excluded3);
725
- try {
726
- yield put(actions.setLoginState({
727
- loading: true
728
- }));
729
-
730
- // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
731
- // @ts-ignore
732
- const preloginRes = yield call(api.auth.passwordlessPreLogin, _extends({}, payload, {
733
- type: AuthStrategyEnum.SmsCode
734
- }));
735
- yield put(actions.setLoginState({
736
- step: LoginStep.loginWithQuickSmsOtc,
737
- loading: false,
738
- phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
739
- error: undefined
740
- }));
741
- callback == null ? void 0 : callback(true);
742
- } catch (e) {
743
- yield put(actions.setLoginState({
744
- error: errorHandler(e),
745
- loading: false
746
- }));
747
- callback == null ? void 0 : callback(e);
748
- }
749
- }
750
- function* passwordlessPreLogin(_ref7) {
751
- let {
752
- payload: {
753
- callback
754
- }
755
- } = _ref7,
756
- payload = _objectWithoutPropertiesLoose(_ref7.payload, _excluded4);
757
- try {
758
- const {
759
- onRedirectTo,
760
- routes
761
- } = yield select(({
762
- auth: {
763
- onRedirectTo,
764
- routes
765
- }
766
- }) => ({
767
- onRedirectTo,
768
- routes
769
- }));
770
- yield put(actions.setLoginState({
771
- loading: true
772
- }));
773
-
774
- // TODO: [Typescript 4.8] fix @frontegg/rest-api return value
775
- // @ts-ignore
776
- const preloginRes = yield call(api.auth.passwordlessPreLogin, payload);
777
- const step = authStrategyLoginStepMap[payload.type];
778
- if (step === LoginStep.loginWithSmsOtc && preloginRes.resetPhoneNumberToken) {
779
- yield put(actions.setResetPhoneNumberState({
780
- resetPhoneNumberToken: preloginRes.resetPhoneNumberToken,
781
- step: ResetPhoneNumberStep.VerifyResetPhoneNumber
782
- }));
783
- onRedirectTo(routes.resetPhoneNumberUrl);
784
- return;
785
- }
786
- yield put(actions.setLoginState({
787
- step,
788
- loading: false,
789
- phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
790
- email: payload.email,
791
- error: undefined
792
- }));
793
- callback == null ? void 0 : callback();
794
- } catch (e) {
795
- yield put(actions.setLoginState({
796
- error: errorHandler(e),
797
- loading: false
798
- }));
799
- callback == null ? void 0 : callback();
800
- }
801
- }
802
- export function* shouldShowPromptPasskeys() {
803
- const {
804
- publicAuthStrategyPolicy
805
- } = yield select(state => state.auth.securityPolicyState);
806
- const {
807
- policy
808
- } = publicAuthStrategyPolicy;
809
- const isPasskeysEnabledByVendor = getPasskeysVendorPolicy(policy);
810
- const isLoggedInWithPasskeys = localStorage.getItem('preferred-login-method') === 'Passkeys';
811
- const isMarkedDontShowAgainPrompt = localStorage.getItem('dont-show-again-prompt-passkeys') === 'true';
812
- const [showPasskeys] = yield call(getFeatureFlags, ['show-passkeys-new']);
813
- if (!showPasskeys || !isPasskeysEnabledByVendor || isLoggedInWithPasskeys || isMarkedDontShowAgainPrompt) {
814
- return false;
815
- } else {
816
- const {
817
- devices
818
- } = yield call(api.auth.getWebAuthnDevices);
819
- yield put(actions.setPasskeysState({
820
- devices: devices != null ? devices : []
821
- }));
822
- const numOfDevices = !(devices != null && devices.length) ? 0 : devices.length;
823
- return numOfDevices === 0;
824
- }
825
- }
826
- function* passwordlessPostLogin(_ref8) {
827
- let {
828
- payload: {
829
- callback,
830
- events
831
- }
832
- } = _ref8,
833
- payload = _objectWithoutPropertiesLoose(_ref8.payload, _excluded5);
834
- try {
835
- yield put(actions.setLoginState({
836
- loading: true
837
- }));
838
- const {
839
- user,
840
- tenants = [],
841
- activeTenant
842
- } = yield call(api.auth.passwordlessPostLoginV2, payload);
843
- const onRedirectTo = ContextHolder.onRedirectTo;
844
- const {
845
- routes
846
- } = yield select(state => state.auth);
847
- if (isMfaRequired(user)) {
848
- const mfaRequiredState = yield getMfaRequiredState(user);
849
- yield put(actions.setState(mfaRequiredState));
850
- onRedirectTo(routes.loginUrl, {
851
- preserveQueryParams: true
852
- });
853
- } else {
854
- const {
855
- loginState
856
- } = yield select(state => state.auth);
857
- if (user.emailVerified) {
858
- var _events$userVerified;
859
- const userVerifiedPayload = {
860
- email: user.email,
861
- origin: UserVeirifedOriginTypes.PASSWORDLESS,
862
- id: user.id,
863
- tenantId: user.tenantId,
864
- createdAt: new Date(),
865
- name: user.name
866
- };
867
- events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
868
- reportGTMEvent(GTMEventAction.USER_VERIFIED, userVerifiedPayload);
869
- }
870
- if (user.id) {
871
- localStorage.setItem('userId', user.id);
872
- }
873
- yield call(afterAuthenticationStateUpdate, {
874
- user,
875
- tenants,
876
- activeTenant
877
- });
878
- yield put(actions.setLoginState({
879
- error: undefined
880
- }));
881
- yield put(actions.setState({
882
- isLoading: false
883
- }));
884
- if (loginState.flow === LoginFlow.Login) {
885
- const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
886
- if (shouldShowPrompt) {
887
- yield put(actions.setLoginState({
888
- step: LoginStep.promptPasskeys,
889
- loading: false
890
- }));
891
- onRedirectTo(routes.loginUrl, {
892
- preserveQueryParams: true
893
- });
894
- } else {
895
- yield put(actions.setState({
896
- isAuthenticated: true
897
- }));
898
- yield afterAuthNavigation();
899
- }
900
- } else {
901
- onRedirectTo(routes.loginUrl, {
902
- preserveQueryParams: true
903
- });
904
- }
905
- localStorage.removeItem('register-quick-login');
906
- callback == null ? void 0 : callback(true);
907
- }
908
- } catch (e) {
909
- yield put(actions.setLoginState({
910
- error: errorHandler(e, 'Failed to authenticate')
911
- }));
912
- } finally {
913
- yield put(actions.setLoginState({
914
- loading: false
915
- }));
916
- }
917
- }
918
- function* verifyInviteToken({
919
- payload
920
- }) {
921
- try {
922
- yield put(actions.setLoginState({
923
- loading: true
924
- }));
925
- const {
926
- name: inviteTokenTenantName
927
- } = yield call(api.auth.verifyInviteToken, payload);
928
- yield put(actions.setLoginState({
929
- inviteTokenTenantName
930
- }));
931
- } catch (e) {
932
- yield put(actions.setLoginState({
933
- inviteTokenError: errorHandler(e, `We couldn't verify your invitation`)
934
- }));
935
- } finally {
936
- yield put(actions.setLoginState({
937
- loading: false
938
- }));
939
- }
940
- }
941
- function* preLogin({
942
- payload: {
943
- email,
944
- recaptchaToken,
945
- invitationToken,
946
- callback
947
- }
948
- }) {
949
- yield put(actions.setLoginState({
950
- loading: true
951
- }));
952
- try {
953
- const onRedirectTo = yield select(({
954
- auth: {
955
- onRedirectTo
956
- }
957
- }) => onRedirectTo);
958
- const tenantId = getSearchParam(TENANT_ID_PARAM_KEY);
959
- const {
960
- address,
961
- idpType
962
- } = yield call(api.auth.preLoginV2, {
963
- email,
964
- tenantId
965
- });
966
- if (address) {
967
- let ssoRedirectUrl = address;
968
- if (idpType === SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
969
- const {
970
- routes: {
971
- oidcRedirectUrl
972
- }
973
- } = yield select(({
974
- auth: {
975
- routes
976
- }
977
- }) => ({
978
- routes
979
- }));
980
- ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
981
- }
982
- yield put(actions.setLoginState({
983
- step: LoginStep.redirectToSSO,
984
- loading: false,
985
- ssoRedirectUrl
986
- }));
987
- setTimeout(() => {
988
- onRedirectTo(ssoRedirectUrl, {
989
- refresh: true
990
- });
991
- }, 2000);
992
- } else {
993
- yield ssoPreloginFailed({
994
- email,
995
- recaptchaToken,
996
- callback,
997
- invitationToken
998
- });
999
- }
1000
- } catch (e) {
1001
- yield ssoPreloginFailed({
1002
- email,
1003
- recaptchaToken,
1004
- callback,
1005
- invitationToken
1006
- });
1007
- }
1008
- }
1009
- function* ssoPreloginFailed(_ref9) {
1010
- let {
1011
- callback
1012
- } = _ref9,
1013
- body = _objectWithoutPropertiesLoose(_ref9, _excluded6);
1014
- const publicPolicy = yield select(({
1015
- auth: {
1016
- securityPolicyState: {
1017
- publicPolicy: {
1018
- policy: publicPolicy
1019
- }
1020
- }
1021
- }
1022
- }) => publicPolicy);
1023
- if (!(publicPolicy != null && publicPolicy.authStrategy)) {
1024
- yield put(actions.setLoginState({
1025
- step: LoginStep.loginWithPassword,
1026
- loading: false
1027
- }));
1028
- callback == null ? void 0 : callback();
1029
- return;
1030
- }
1031
- if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === AuthStrategyEnum.EmailAndPassword) {
1032
- yield put(actions.setLoginState({
1033
- step: LoginStep.loginWithPassword,
1034
- loading: false
1035
- }));
1036
- callback == null ? void 0 : callback();
1037
- } else if ([AuthStrategyEnum.MagicLink, AuthStrategyEnum.Code, AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
1038
- yield put(actions.passwordlessPreLogin(_extends({}, body, {
1039
- type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
1040
- callback
1041
- })));
1042
- } else {
1043
- yield put(actions.setLoginState({
1044
- step: LoginStep.loginWithPassword,
1045
- loading: false
1046
- }));
1047
- callback == null ? void 0 : callback();
1048
- }
1049
- }
1050
- function* webAuthnCreateNewDeviceSession({
1051
- payload: {
1052
- callback
1053
- }
1054
- }) {
1055
- try {
1056
- yield put(actions.setLoginState({
1057
- loading: true
1058
- }));
1059
- const {
1060
- options
1061
- } = yield call(api.auth.webAuthnCreateNewDeviceSession);
1062
- options.user.id = base64urlDecode(options.user.id);
1063
- options.challenge = base64urlDecode(options.challenge);
1064
- options.excludeCredentials = [];
1065
- callback == null ? void 0 : callback(options);
1066
- } catch (e) {
1067
- yield put(actions.setLoginState({
1068
- error: errorHandler(e)
1069
- }));
1070
- callback == null ? void 0 : callback(null);
1071
- } finally {
1072
- yield put(actions.setLoginState({
1073
- loading: false
1074
- }));
1075
- }
1076
- }
1077
- function* webAuthnVerifyNewDeviceSession(_ref10) {
1078
- let {
1079
- payload: {
1080
- callback
1081
- }
1082
- } = _ref10,
1083
- body = _objectWithoutPropertiesLoose(_ref10.payload, _excluded7);
1084
- try {
1085
- yield put(actions.setLoginState({
1086
- loading: true
1087
- }));
1088
- const publicKey = publicKeyCredentialToJSON(body.publicKey);
1089
- const deviceType = (publicKey == null ? void 0 : publicKey.authenticatorAttachment) === 'platform' ? WebAuthnDeviceType.Platform : WebAuthnDeviceType.CrossPlatform;
1090
- yield call(api.auth.verifyNewDeviceSession, {
1091
- id: publicKey.id,
1092
- response: publicKey.response,
1093
- deviceType: deviceType
1094
- });
1095
- callback == null ? void 0 : callback(true);
1096
- } catch (e) {
1097
- yield put(actions.setLoginState({
1098
- error: errorHandler(e)
1099
- }));
1100
- callback == null ? void 0 : callback(null);
1101
- } finally {
1102
- yield put(actions.setLoginState({
1103
- loading: false
1104
- }));
1105
- }
1106
- }
1107
- function* webAuthnPrelogin(_ref11) {
1108
- let {
1109
- payload: {
1110
- callback
1111
- }
1112
- } = _ref11,
1113
- body = _objectWithoutPropertiesLoose(_ref11.payload, _excluded8);
1114
- try {
1115
- var _options$allowCredent;
1116
- yield put(actions.setPasskeysState({
1117
- loading: true
1118
- }));
1119
- yield put(actions.setLoginState({
1120
- loading: true
1121
- }));
1122
- const {
1123
- options
1124
- } = yield call(api.auth.webAuthnPreLogin, body);
1125
- options.challenge = base64urlDecode(options.challenge);
1126
- options.allowCredentials = (_options$allowCredent = options.allowCredentials) == null ? void 0 : _options$allowCredent.map(credentials => _extends({}, credentials, {
1127
- id: base64urlDecode(credentials.id)
1128
- }));
1129
- yield put(actions.setLoginState({
1130
- error: undefined
1131
- }));
1132
- callback == null ? void 0 : callback(options);
1133
- } catch (e) {
1134
- yield put(actions.setLoginState({
1135
- error: errorHandler(e)
1136
- }));
1137
- callback == null ? void 0 : callback(null);
1138
- } finally {
1139
- yield put(actions.setPasskeysState({
1140
- loading: false
1141
- }));
1142
- yield put(actions.setLoginState({
1143
- loading: false
1144
- }));
1145
- }
1146
- }
1147
- function* webAuthnPostLogin(_ref12) {
1148
- let {
1149
- payload: {
1150
- callback
1151
- }
1152
- } = _ref12,
1153
- body = _objectWithoutPropertiesLoose(_ref12.payload, _excluded9);
1154
- try {
1155
- var _publicKey$response$u;
1156
- yield put(actions.setPasskeysState({
1157
- loading: true
1158
- }));
1159
- yield put(actions.setLoginState({
1160
- loading: true
1161
- }));
1162
- const publicKey = publicKeyCredentialToJSON(body.publicKey);
1163
- const _yield$call = yield call(api.auth.webAuthnPostLoginV2, _extends({}, publicKey, {
1164
- response: _extends({}, publicKey.response, {
1165
- userHandle: (_publicKey$response$u = publicKey.response.userHandle) != null ? _publicKey$response$u : undefined
1166
- }),
1167
- recaptchaToken: body.recaptchaToken,
1168
- invitationToken: body.invitationToken
1169
- })),
1170
- {
1171
- user
1172
- } = _yield$call,
1173
- rest = _objectWithoutPropertiesLoose(_yield$call, _excluded10);
1174
- if (isMfaRequired(user)) {
1175
- const onRedirectTo = ContextHolder.onRedirectTo;
1176
- const {
1177
- routes
1178
- } = yield select(state => state.auth);
1179
- const mfaRequiredState = yield getMfaRequiredState(user);
1180
- yield put(actions.setState(mfaRequiredState));
1181
- onRedirectTo(routes.loginUrl, {
1182
- preserveQueryParams: true
1183
- });
1184
- } else {
1185
- if (user.id) {
1186
- localStorage.setItem('userId', user.id);
1187
- }
1188
- yield call(afterAuthenticationStateUpdate, _extends({
1189
- user
1190
- }, rest), {
1191
- isAuthenticated: true
1192
- });
1193
- yield put(actions.setLoginState({
1194
- error: undefined
1195
- }));
1196
- yield afterAuthNavigation();
1197
- // TODO: Itamar why moving callback to inside the else block
1198
- callback == null ? void 0 : callback(true);
1199
- }
1200
- // callback?.(true);
1201
- } catch (e) {
1202
- yield put(actions.setLoginState({
1203
- error: errorHandler(e)
1204
- }));
1205
- callback == null ? void 0 : callback(null);
1206
- } finally {
1207
- yield put(actions.setPasskeysState({
1208
- loading: false
1209
- }));
1210
- yield put(actions.setLoginState({
1211
- loading: false
1212
- }));
1213
- }
1214
- }
1215
- function* postLogin({
1216
- payload
1217
- }) {
1218
- const {
1219
- onRedirectTo,
1220
- routes
1221
- } = yield select(({
1222
- auth: {
1223
- onRedirectTo,
1224
- routes
1225
- }
1226
- }) => ({
1227
- onRedirectTo,
1228
- routes
1229
- }));
1230
- yield put(actions.setLoginState({
1231
- loading: true
1232
- }));
1233
- try {
1234
- const user = yield call(api.auth.postLogin, payload);
1235
- yield put(actions.setState({
1236
- user: !!user.accessToken ? user : undefined,
1237
- isAuthenticated: !!user.accessToken
1238
- }));
1239
- yield afterAuthNavigation();
1240
- } catch (e) {
1241
- setTimeout(() => {
1242
- onRedirectTo(routes.authenticatedUrl);
1243
- }, 1000);
1244
- yield put(actions.setLoginState({
1245
- step: LoginStep.loginWithSSOFailed,
1246
- loading: false
1247
- }));
1248
- }
1249
- }
1250
- function* login({
1251
- payload: {
1252
- email,
1253
- password,
1254
- recaptchaToken,
1255
- invitationToken,
1256
- callback
1257
- }
1258
- }) {
1259
- yield put(actions.setLoginState({
1260
- loading: true
1261
- }));
1262
- try {
1263
- const {
1264
- user,
1265
- tenants = [],
1266
- activeTenant
1267
- } = yield call(api.auth.loginv2, {
1268
- email,
1269
- password,
1270
- recaptchaToken,
1271
- invitationToken
1272
- });
1273
- const onRedirectTo = ContextHolder.onRedirectTo;
1274
- const {
1275
- routes
1276
- } = yield select(state => state.auth);
1277
- if (isMfaRequired(user)) {
1278
- const mfaRequiredState = yield getMfaRequiredState(user);
1279
- yield put(actions.setState(mfaRequiredState));
1280
- onRedirectTo(routes.loginUrl, {
1281
- preserveQueryParams: true
1282
- });
1283
- } else {
1284
- const {
1285
- loginState
1286
- } = yield select(state => state.auth);
1287
- const isAuthenticated = !!user.accessToken;
1288
- if (user.id) {
1289
- localStorage.setItem('userId', user.id);
1290
- }
1291
- yield call(afterAuthenticationStateUpdate, {
1292
- user,
1293
- tenants,
1294
- activeTenant
1295
- }, {
1296
- loginState: {
1297
- flow: loginState.flow,
1298
- quickLoginToRegister: loginState.quickLoginToRegister,
1299
- email,
1300
- loading: false,
1301
- error: undefined,
1302
- mfaToken: user.mfaToken,
1303
- step: loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step,
1304
- tenants,
1305
- tenantsLoading: true,
1306
- isBreachedPassword: user.isBreachedPassword
1307
- },
1308
- isAuthenticated
1309
- });
1310
- const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
1311
- if (loginState.flow === LoginFlow.Login) {
1312
- if (securityCenterLoginFlows && user.isBreachedPassword) {
1313
- yield put(actions.setLoginState({
1314
- step: LoginStep.breachedPassword,
1315
- loading: false
1316
- }));
1317
- } else {
1318
- if (isAuthenticated) {
1319
- const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
1320
- if (shouldShowPrompt) {
1321
- yield put(actions.setLoginState({
1322
- step: LoginStep.promptPasskeys,
1323
- loading: false
1324
- }));
1325
- onRedirectTo(routes.loginUrl, {
1326
- preserveQueryParams: true
1327
- });
1328
- } else {
1329
- yield afterAuthNavigation();
1330
- }
1331
- }
1332
- }
1333
- }
1334
- }
1335
-
1336
- // TODO: extract item name to constants
1337
- localStorage.removeItem('register-quick-login');
1338
- callback == null ? void 0 : callback(true);
1339
- } catch (e) {
1340
- ContextHolder.setAccessToken(null);
1341
- ContextHolder.setUser(null);
1342
- callback == null ? void 0 : callback(false, e);
1343
- yield put(actions.setLoginState({
1344
- email,
1345
- error: errorHandler(e),
1346
- loading: false
1347
- }));
1348
- }
1349
- }
1350
- function* loginWithMfa({
1351
- payload: {
1352
- mfaToken,
1353
- value,
1354
- rememberDevice,
1355
- callback
1356
- }
1357
- }) {
1358
- yield put(actions.setLoginState({
1359
- loading: true
1360
- }));
1361
- try {
1362
- const {
1363
- user,
1364
- tenants = [],
1365
- activeTenant
1366
- } = yield call(api.auth.loginWithMfaV2, {
1367
- mfaToken,
1368
- value,
1369
- rememberDevice
1370
- });
1371
- const {
1372
- loginState
1373
- } = yield select(state => state.auth);
1374
- const step = loginState.flow === LoginFlow.Login ? LoginStep.success : loginState.step;
1375
- const isAuthenticated = !!user.accessToken;
1376
- yield call(afterAuthenticationStateUpdate, {
1377
- user,
1378
- tenants,
1379
- activeTenant
1380
- }, {
1381
- loginState: {
1382
- flow: loginState.flow,
1383
- quickLoginToRegister: loginState.quickLoginToRegister,
1384
- loading: false,
1385
- step,
1386
- error: undefined,
1387
- tenants
1388
- },
1389
- isAuthenticated
1390
- });
1391
- if (user.id) {
1392
- localStorage.setItem('userId', user.id);
1393
- }
1394
- yield put(actions.setLoginState({
1395
- error: undefined,
1396
- loading: false
1397
- }));
1398
- const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
1399
- if (loginState.flow === LoginFlow.Login) {
1400
- if (securityCenterLoginFlows && loginState.isBreachedPassword) {
1401
- yield put(actions.setLoginState({
1402
- step: LoginStep.breachedPassword,
1403
- loading: false
1404
- }));
1405
- } else {
1406
- const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
1407
- if (shouldShowPrompt) {
1408
- yield put(actions.setLoginState({
1409
- step: LoginStep.promptPasskeys,
1410
- loading: false
1411
- }));
1412
- } else {
1413
- yield afterAuthNavigation();
1414
- }
1415
- }
1416
- }
1417
- callback == null ? void 0 : callback(true);
1418
- } catch (e) {
1419
- yield put(actions.setLoginState({
1420
- error: errorHandler(e),
1421
- loading: false
1422
- }));
1423
- callback == null ? void 0 : callback(false, e);
1424
- }
1425
- }
1426
- function* recoverMfa({
1427
- payload
1428
- }) {
1429
- yield put(actions.setLoginState({
1430
- loading: true
1431
- }));
1432
- try {
1433
- var _payload$callback;
1434
- yield call(api.auth.recoverMfaToken, payload);
1435
- yield put(actions.setLoginState({
1436
- loading: false,
1437
- error: undefined,
1438
- step: LoginStep.preLogin
1439
- }));
1440
- yield put(actions.setState({
1441
- user: undefined,
1442
- isAuthenticated: false
1443
- }));
1444
- (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
1445
- } catch (e) {
1446
- var _payload$callback2;
1447
- yield put(actions.setLoginState({
1448
- error: errorHandler(e),
1449
- loading: false
1450
- }));
1451
- (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
1452
- }
1453
- }
1454
- function* logout({
1455
- payload
1456
- }) {
1457
- const {
1458
- hostedLoginBox
1459
- } = yield select(state => state.auth);
1460
- yield put(actions.setState({
1461
- isLoading: true
1462
- }));
1463
- try {
1464
- if (hostedLoginBox) {
1465
- yield call(api.auth.OAuthLogout);
1466
- } else {
1467
- yield call(api.auth.logout);
1468
- }
1469
- } catch {}
1470
- yield put(actions.resetState());
1471
- yield put(actions.requestAuthorize(true));
1472
- payload == null ? void 0 : payload();
1473
- }
1474
- function* silentLogout({
1475
- payload
1476
- }) {
1477
- var _payload$callbackTime;
1478
- try {
1479
- yield call(api.auth.logout);
1480
- } catch {}
1481
- setTimeout(() => {
1482
- var _payload$callback3;
1483
- return payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
1484
- }, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
1485
- }
1486
- function* handleEnrollMFAResponse({
1487
- user,
1488
- tenants,
1489
- activeTenant
1490
- }) {
1491
- const mfaState = {
1492
- step: MFAStep.recoveryCode,
1493
- loading: false,
1494
- error: undefined,
1495
- saving: false
1496
- };
1497
- if (user != null && user.recoveryCode) {
1498
- mfaState.recoveryCode = user.recoveryCode;
1499
- }
1500
- yield put(actions.setMfaState(mfaState));
1501
- yield put(actions.setUser(user));
1502
- yield put(actions.setTenantsState({
1503
- tenants,
1504
- activeTenant,
1505
- loading: false
1506
- }));
1507
- if (user.id) {
1508
- localStorage.setItem('userId', user.id);
1509
- }
1510
- }
1511
- function* handleVerifyMFAResponse({
1512
- user,
1513
- tenants,
1514
- activeTenant
1515
- }) {
1516
- const {
1517
- loginState
1518
- } = yield select(state => state.auth);
1519
- yield put(actions.setUser(user));
1520
- yield put(actions.setTenantsState({
1521
- tenants,
1522
- activeTenant,
1523
- loading: false
1524
- }));
1525
- if (user.id) {
1526
- localStorage.setItem('userId', user.id);
1527
- }
1528
- const {
1529
- step: mfaStep
1530
- } = yield select(state => state.auth.mfaState);
1531
- const [securityCenterLoginFlows] = yield call(getFeatureFlags, ['security-center-show-login-flows']);
1532
- if (loginState.flow === LoginFlow.Login) {
1533
- if (securityCenterLoginFlows && loginState.isBreachedPassword) {
1534
- yield put(actions.setLoginState({
1535
- step: LoginStep.breachedPassword,
1536
- loading: false
1537
- }));
1538
- } else {
1539
- const shouldShowPrompt = yield call(shouldShowPromptPasskeys);
1540
- if (mfaStep === MFAStep.smsVerifyCode && shouldShowPrompt) {
1541
- yield put(actions.setLoginState({
1542
- step: LoginStep.promptPasskeys,
1543
- loading: false
1544
- }));
1545
- } else {
1546
- yield afterAuthNavigation();
1547
- }
1548
- }
1549
- }
1550
- yield put(actions.setState({
1551
- isAuthenticated: !!user.accessToken
1552
- }));
1553
- }
1554
- function* preEnrollMFASMSForLogin(_ref13) {
1555
- let {
1556
- payload: {
1557
- callback
1558
- }
1559
- } = _ref13,
1560
- payload = _objectWithoutPropertiesLoose(_ref13.payload, _excluded11);
1561
- yield put(actions.setLoginState({
1562
- loading: true
1563
- }));
1564
- try {
1565
- const data = yield call(api.auth.preEnrollMFASMSForLogin, payload);
1566
- yield put(actions.setMfaState({
1567
- otcToken: data.otcToken,
1568
- step: MFAStep.smsVerifyCode,
1569
- phoneNumber: data.phoneNumber
1570
- }));
1571
- yield put(actions.setLoginState({
1572
- loading: false
1573
- }));
1574
- callback == null ? void 0 : callback(true);
1575
- } catch (e) {
1576
- yield put(actions.setLoginState({
1577
- loading: false,
1578
- error: errorHandler(e)
1579
- }));
1580
- callback == null ? void 0 : callback(null);
1581
- }
1582
- }
1583
- function* enrollMFASMSForLogin(_ref14) {
1584
- let {
1585
- payload: {
1586
- callback
1587
- }
1588
- } = _ref14,
1589
- payload = _objectWithoutPropertiesLoose(_ref14.payload, _excluded12);
1590
- yield put(actions.setLoginState({
1591
- loading: true
1592
- }));
1593
- try {
1594
- const data = yield call(api.auth.enrollMFASMSForLoginV2, payload);
1595
- yield handleEnrollMFAResponse(data);
1596
- yield put(actions.setLoginState({
1597
- loading: false
1598
- }));
1599
- callback == null ? void 0 : callback(true);
1600
- } catch (e) {
1601
- yield put(actions.setLoginState({
1602
- loading: false,
1603
- error: errorHandler(e)
1604
- }));
1605
- callback == null ? void 0 : callback(null);
1606
- }
1607
- }
1608
- function* preEnrollMFAWebAuthnForLogin(_ref15) {
1609
- let {
1610
- payload: {
1611
- callback
1612
- }
1613
- } = _ref15,
1614
- payload = _objectWithoutPropertiesLoose(_ref15.payload, _excluded13);
1615
- yield put(actions.setLoginState({
1616
- loading: true
1617
- }));
1618
- try {
1619
- var _data$options$exclude;
1620
- const data = yield call(api.auth.preEnrollMFAWebAuthnForLogin, payload);
1621
- const options = _extends({}, data.options, {
1622
- challenge: base64urlDecode(data.options.challenge),
1623
- user: _extends({}, data.options.user, {
1624
- id: base64urlDecode(data.options.user.id)
1625
- }),
1626
- excludeCredentials: (_data$options$exclude = data.options.excludeCredentials) == null ? void 0 : _data$options$exclude.map(credentials => _extends({}, credentials, {
1627
- id: base64urlDecode(credentials.id)
1628
- }))
1629
- });
1630
- yield put(actions.setLoginState({
1631
- loading: false
1632
- }));
1633
- callback == null ? void 0 : callback({
1634
- options,
1635
- webauthnToken: data.webauthnToken
1636
- });
1637
- } catch (e) {
1638
- yield put(actions.setLoginState({
1639
- loading: false,
1640
- error: errorHandler(e)
1641
- }));
1642
- callback == null ? void 0 : callback(null);
1643
- }
1644
- }
1645
- function* enrollMFAWebAuthnForLogin(_ref16) {
1646
- let {
1647
- payload: {
1648
- callback
1649
- }
1650
- } = _ref16,
1651
- payload = _objectWithoutPropertiesLoose(_ref16.payload, _excluded14);
1652
- yield put(actions.setLoginState({
1653
- loading: true
1654
- }));
1655
- try {
1656
- const publicKey = publicKeyCredentialToJSON(payload.publicKey);
1657
- const data = yield call(api.auth.enrollMFAWebAuthnForLoginV2, _extends({}, payload, {
1658
- options: publicKey
1659
- }));
1660
- yield handleEnrollMFAResponse(data);
1661
- yield put(actions.setLoginState({
1662
- loading: false
1663
- }));
1664
- callback == null ? void 0 : callback(true);
1665
- } catch (e) {
1666
- yield put(actions.setLoginState({
1667
- loading: false,
1668
- error: errorHandler(e)
1669
- }));
1670
- callback == null ? void 0 : callback(null);
1671
- }
1672
- }
1673
- function* enrollMFAAuthenticatorAppForLogin(_ref17) {
1674
- let {
1675
- payload: {
1676
- callback
1677
- }
1678
- } = _ref17,
1679
- payload = _objectWithoutPropertiesLoose(_ref17.payload, _excluded15);
1680
- yield put(actions.setLoginState({
1681
- loading: true
1682
- }));
1683
- try {
1684
- const data = yield call(api.auth.enrollMFAAuthenticatorAppForLoginV2, payload);
1685
- yield handleEnrollMFAResponse(data);
1686
- yield put(actions.setLoginState({
1687
- loading: false
1688
- }));
1689
- callback == null ? void 0 : callback(true);
1690
- } catch (e) {
1691
- yield put(actions.setLoginState({
1692
- loading: false,
1693
- error: errorHandler(e)
1694
- }));
1695
- callback == null ? void 0 : callback(null);
1696
- }
1697
- }
1698
- function* preVerifyMFASMSForLogin(_ref18) {
1699
- let {
1700
- payload: {
1701
- callback,
1702
- deviceId
1703
- }
1704
- } = _ref18,
1705
- payload = _objectWithoutPropertiesLoose(_ref18.payload, _excluded16);
1706
- yield put(actions.setLoginState({
1707
- loading: true
1708
- }));
1709
- try {
1710
- const data = yield call(api.auth.preVerifyMFASMSForLogin, deviceId, payload);
1711
- yield put(actions.setMfaState({
1712
- otcToken: data.otcToken,
1713
- step: MFAStep.smsVerifyCode,
1714
- phoneNumber: data.phoneNumber
1715
- }));
1716
- yield put(actions.setLoginState({
1717
- loading: false
1718
- }));
1719
- callback == null ? void 0 : callback(true);
1720
- } catch (e) {
1721
- yield put(actions.setLoginState({
1722
- loading: false,
1723
- error: errorHandler(e)
1724
- }));
1725
- callback == null ? void 0 : callback(null);
1726
- }
1727
- }
1728
- function* preVerifyMFAEmailCode(_ref19) {
1729
- let {
1730
- payload: {
1731
- callback
1732
- }
1733
- } = _ref19,
1734
- payload = _objectWithoutPropertiesLoose(_ref19.payload, _excluded17);
1735
- try {
1736
- const data = yield call(api.auth.preVerifyMFAEmailCode, payload);
1737
- yield put(actions.setMfaState({
1738
- otcToken: data.otcToken,
1739
- step: MFAStep.emailVerifyCode
1740
- }));
1741
- callback == null ? void 0 : callback(true);
1742
- } catch (e) {
1743
- yield put(actions.setLoginState({
1744
- error: errorHandler(e)
1745
- }));
1746
- callback == null ? void 0 : callback(null);
1747
- }
1748
- }
1749
- function* verifyMFAEmailCode(_ref20) {
1750
- let {
1751
- payload: {
1752
- callback
1753
- }
1754
- } = _ref20,
1755
- payload = _objectWithoutPropertiesLoose(_ref20.payload, _excluded18);
1756
- yield put(actions.setLoginState({
1757
- loading: true
1758
- }));
1759
- try {
1760
- const data = yield call(api.auth.verifyMFAEmailCodeV2, payload);
1761
- yield handleVerifyMFAResponse(data);
1762
- yield put(actions.setLoginState({
1763
- loading: false
1764
- }));
1765
- callback == null ? void 0 : callback(true);
1766
- } catch (e) {
1767
- yield put(actions.setLoginState({
1768
- loading: false,
1769
- error: errorHandler(e)
1770
- }));
1771
- callback == null ? void 0 : callback(null);
1772
- }
1773
- }
1774
- function* verifyMFASMSForLogin(_ref21) {
1775
- let {
1776
- payload: {
1777
- callback,
1778
- deviceId
1779
- }
1780
- } = _ref21,
1781
- payload = _objectWithoutPropertiesLoose(_ref21.payload, _excluded19);
1782
- yield put(actions.setLoginState({
1783
- loading: true
1784
- }));
1785
- try {
1786
- const data = yield call(api.auth.verifyMFASMSForLoginV2, deviceId, payload);
1787
- yield handleVerifyMFAResponse(data);
1788
- yield put(actions.setLoginState({
1789
- loading: false
1790
- }));
1791
- callback == null ? void 0 : callback(true);
1792
- } catch (e) {
1793
- yield put(actions.setLoginState({
1794
- loading: false,
1795
- error: errorHandler(e)
1796
- }));
1797
- callback == null ? void 0 : callback(null);
1798
- }
1799
- }
1800
- function* preVerifyMFAWebAuthnForLogin(_ref22) {
1801
- let {
1802
- payload: {
1803
- callback,
1804
- deviceId
1805
- }
1806
- } = _ref22,
1807
- payload = _objectWithoutPropertiesLoose(_ref22.payload, _excluded20);
1808
- yield put(actions.setLoginState({
1809
- loading: true
1810
- }));
1811
- try {
1812
- var _data$options$allowCr;
1813
- const data = yield call(api.auth.preVerifyMFAWebAuthnForLogin, deviceId, payload);
1814
- const options = _extends({}, data.options, {
1815
- challenge: base64urlDecode(data.options.challenge),
1816
- allowCredentials: (_data$options$allowCr = data.options.allowCredentials) == null ? void 0 : _data$options$allowCr.map(credentials => _extends({}, credentials, {
1817
- id: base64urlDecode(credentials.id)
1818
- }))
1819
- });
1820
- yield put(actions.setLoginState({
1821
- loading: false
1822
- }));
1823
- callback == null ? void 0 : callback({
1824
- options,
1825
- webauthnToken: data.webauthnToken
1826
- });
1827
- } catch (e) {
1828
- yield put(actions.setLoginState({
1829
- loading: false,
1830
- error: errorHandler(e)
1831
- }));
1832
- callback == null ? void 0 : callback(null);
1833
- }
1834
- }
1835
- function* verifyMFAWebAuthnForLogin(_ref23) {
1836
- let {
1837
- payload: {
1838
- callback,
1839
- deviceId
1840
- }
1841
- } = _ref23,
1842
- payload = _objectWithoutPropertiesLoose(_ref23.payload, _excluded21);
1843
- yield put(actions.setLoginState({
1844
- loading: true
1845
- }));
1846
- try {
1847
- const publicKey = publicKeyCredentialToJSON(payload.publicKey);
1848
- const data = yield call(api.auth.verifyMFAWebAuthnForLoginV2, deviceId, _extends({}, payload, {
1849
- options: publicKey
1850
- }));
1851
- yield handleVerifyMFAResponse(data);
1852
- yield put(actions.setLoginState({
1853
- loading: false
1854
- }));
1855
- callback == null ? void 0 : callback(true);
1856
- } catch (e) {
1857
- yield put(actions.setLoginState({
1858
- loading: false,
1859
- error: errorHandler(e)
1860
- }));
1861
- callback == null ? void 0 : callback(null);
1862
- }
1863
- }
1864
- function* resetBreachedPassword({
1865
- payload
1866
- }) {
1867
- yield put(actions.setLoginState({
1868
- loading: true
1869
- }));
1870
- try {
1871
- yield call(api.auth.forgotPassword, payload);
1872
- yield put(actions.setLoginState({
1873
- loading: false,
1874
- error: undefined,
1875
- step: LoginStep.breachedPasswordSuccess
1876
- }));
1877
- yield put(actions.setState({
1878
- isAuthenticated: false
1879
- }));
1880
- } catch (e) {
1881
- yield put(actions.setLoginState({
1882
- loading: false,
1883
- error: errorHandler(e)
1884
- }));
1885
- }
1886
- }
1887
- export function* loginSagas() {
1888
- yield takeLeading(actions.requestAuthorize, requestAuthorize);
1889
- yield takeLeading(actions.requestAuthorizeSSR, requestAuthorizeSSR);
1890
- yield takeLeading(actions.requestHostedLoginAuthorize, refreshOrRequestHostedLoginAuthorize);
1891
- yield takeLeading(actions.requestHostedLoginAuthorizeV2, refreshOrRequestHostedLoginAuthorizeV2);
1892
- yield takeLeading(actions.handleHostedLoginCallback, handleHostedLoginCallback);
1893
- yield takeLeading(actions.preLogin, preLogin);
1894
- yield takeLeading(actions.postLogin, postLogin);
1895
- yield takeLeading(actions.login, login);
1896
- yield takeLeading(actions.logout, logout);
1897
- yield takeLeading(actions.silentLogout, silentLogout);
1898
- yield takeLeading(actions.loginWithMfa, loginWithMfa);
1899
- yield takeLeading(actions.recoverMfa, recoverMfa);
1900
- yield takeLeading(actions.quickSmsPasswordlessPreLogin, quickSmsPasswordlessPreLogin);
1901
- yield takeLeading(actions.changePhoneNumberWithVerification, changePhoneNumberWithVerification);
1902
- yield takeLeading(actions.verifyChangePhoneNumber, verifyChangePhoneNumber);
1903
- yield takeLeading(actions.passwordlessPreLogin, passwordlessPreLogin);
1904
- yield takeLeading(actions.passwordlessPostLogin, passwordlessPostLogin);
1905
- yield takeLeading(actions.verifyInviteToken, verifyInviteToken);
1906
- yield takeLeading(actions.webAuthnPrelogin, webAuthnPrelogin);
1907
- yield takeLeading(actions.webAuthnPostLogin, webAuthnPostLogin);
1908
- yield takeLeading(actions.webAuthnCreateNewDeviceSession, webAuthnCreateNewDeviceSession);
1909
- yield takeLeading(actions.webAuthnVerifyNewDeviceSession, webAuthnVerifyNewDeviceSession);
1910
- yield takeLeading(actions.afterAuthNavigation, afterAuthNavigation);
1911
- yield takeLeading(actions.getUserIP, getUserIP);
1912
- yield takeLeading(actions.preEnrollMFASMSForLogin, preEnrollMFASMSForLogin);
1913
- yield takeLeading(actions.enrollMFASMSForLogin, enrollMFASMSForLogin);
1914
- yield takeLeading(actions.preEnrollMFAWebAuthnForLogin, preEnrollMFAWebAuthnForLogin);
1915
- yield takeLeading(actions.enrollMFAWebAuthnForLogin, enrollMFAWebAuthnForLogin);
1916
- yield takeLeading(actions.enrollMFAAuthenticatorAppForLogin, enrollMFAAuthenticatorAppForLogin);
1917
- yield takeLeading(actions.preVerifyMFASMSForLogin, preVerifyMFASMSForLogin);
1918
- yield takeLeading(actions.verifyMFASMSForLogin, verifyMFASMSForLogin);
1919
- yield takeLeading(actions.preVerifyMFAWebAuthnForLogin, preVerifyMFAWebAuthnForLogin);
1920
- yield takeLeading(actions.verifyMFAWebAuthnForLogin, verifyMFAWebAuthnForLogin);
1921
- yield takeLeading(actions.preVerifyMFAEmailCode, preVerifyMFAEmailCode);
1922
- yield takeLeading(actions.verifyMFAEmailCode, verifyMFAEmailCode);
1923
- yield takeLeading(actions.resetBreachedPassword, resetBreachedPassword);
1924
- }
1925
-
1926
- /*********************************
1927
- * Preview Sagas
1928
- *********************************/
1929
-
1930
- function* requestAuthorizeMock({
1931
- payload: firstTime
1932
- }) {
1933
- if (firstTime) {
1934
- yield put(actions.setState({
1935
- isLoading: true
1936
- }));
1937
- }
1938
- const user = userDemo;
1939
- yield put(actions.loadTenants());
1940
- yield put(actions.setState({
1941
- user,
1942
- isAuthenticated: true,
1943
- isLoading: false
1944
- }));
1945
- }
1946
- function* getUserIPMock({
1947
- payload: {
1948
- callback
1949
- }
1950
- }) {
1951
- try {
1952
- const {
1953
- ip
1954
- } = dummyIps[0];
1955
- yield put(actions.setState({
1956
- userIp: ip
1957
- }));
1958
- callback == null ? void 0 : callback(true, ip);
1959
- } catch (e) {
1960
- callback == null ? void 0 : callback(false, e);
1961
- }
1962
- }
1963
- export function* loginSagasMock() {
1964
- yield takeLeading(actions.requestAuthorize, requestAuthorizeMock);
1965
- yield takeLeading(actions.afterAuthNavigation, afterAuthNavigation);
1966
- yield takeLeading(actions.getUserIP, getUserIPMock);
1967
- }