@frontegg/redux-store 6.69.0 → 6.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/audits/AuditLogsState/index.js +1 -1
  2. package/audits/AuditLogsState/saga.js +1 -18
  3. package/audits/AuditsMetadataState/index.js +1 -1
  4. package/audits/AuditsMetadataState/saga.js +1 -5
  5. package/audits/backward-compatibility/saga.js +0 -18
  6. package/audits/dummy.js +0 -16
  7. package/audits/index.js +4 -2
  8. package/audits/reducer.js +0 -2
  9. package/auth/AcceptInvitationState/index.d.ts +2 -0
  10. package/auth/AcceptInvitationState/index.js +1 -1
  11. package/auth/AcceptInvitationState/interfaces.js +0 -1
  12. package/auth/AcceptInvitationState/saga.js +0 -3
  13. package/auth/AccountSettingsState/index.d.ts +2 -0
  14. package/auth/AccountSettingsState/index.js +1 -1
  15. package/auth/AccountSettingsState/interfaces.d.ts +2 -0
  16. package/auth/AccountSettingsState/saga.js +1 -11
  17. package/auth/ActivateState/index.d.ts +3 -0
  18. package/auth/ActivateState/index.js +1 -1
  19. package/auth/ActivateState/interfaces.js +0 -1
  20. package/auth/ActivateState/saga.js +14 -34
  21. package/auth/ApiTokensState/index.d.ts +2 -0
  22. package/auth/ApiTokensState/index.js +1 -1
  23. package/auth/ApiTokensState/interfaces.d.ts +1 -0
  24. package/auth/ApiTokensState/interfaces.js +0 -1
  25. package/auth/ApiTokensState/saga.js +1 -44
  26. package/auth/ForgotPasswordState/index.d.ts +2 -0
  27. package/auth/ForgotPasswordState/index.js +1 -1
  28. package/auth/ForgotPasswordState/interfaces.js +0 -1
  29. package/auth/ForgotPasswordState/saga.js +5 -12
  30. package/auth/ImpersonationState/index.d.ts +2 -0
  31. package/auth/ImpersonationState/index.js +1 -1
  32. package/auth/ImpersonationState/interfaces.js +0 -1
  33. package/auth/ImpersonationState/saga.js +5 -9
  34. package/auth/LoginState/index.d.ts +2 -0
  35. package/auth/LoginState/index.js +1 -1
  36. package/auth/LoginState/interfaces.js +0 -6
  37. package/auth/LoginState/saga.d.ts +2 -38
  38. package/auth/LoginState/saga.js +132 -292
  39. package/auth/MfaState/index.d.ts +4 -2
  40. package/auth/MfaState/index.js +1 -1
  41. package/auth/MfaState/interfaces.d.ts +2 -2
  42. package/auth/MfaState/interfaces.js +0 -1
  43. package/auth/MfaState/saga.js +64 -143
  44. package/auth/ProfileState/index.d.ts +2 -0
  45. package/auth/ProfileState/index.js +1 -1
  46. package/auth/ProfileState/saga.js +22 -50
  47. package/auth/Provisioning/index.d.ts +2 -0
  48. package/auth/Provisioning/index.js +1 -1
  49. package/auth/Provisioning/saga.js +11 -23
  50. package/auth/ResetPhoneNumberState/index.d.ts +2 -0
  51. package/auth/ResetPhoneNumberState/index.js +1 -1
  52. package/auth/ResetPhoneNumberState/interfaces.js +0 -1
  53. package/auth/ResetPhoneNumberState/saga.js +17 -26
  54. package/auth/RestrictionsState/index.d.ts +3 -0
  55. package/auth/RestrictionsState/index.js +1 -1
  56. package/auth/RestrictionsState/saga.js +52 -105
  57. package/auth/RolesState/index.d.ts +2 -0
  58. package/auth/RolesState/index.js +1 -1
  59. package/auth/RolesState/saga.js +30 -51
  60. package/auth/SSOState/index.d.ts +2 -0
  61. package/auth/SSOState/index.js +1 -1
  62. package/auth/SSOState/interfaces.js +0 -3
  63. package/auth/SSOState/saga.js +10 -58
  64. package/auth/SSOState/saga.v2.js +13 -49
  65. package/auth/SecurityPolicyState/index.d.ts +13 -0
  66. package/auth/SecurityPolicyState/index.js +1 -1
  67. package/auth/SecurityPolicyState/saga.js +36 -90
  68. package/auth/SessionsPolicyState/index.d.ts +2 -0
  69. package/auth/SessionsPolicyState/index.js +1 -1
  70. package/auth/SessionsPolicyState/saga.js +7 -19
  71. package/auth/SessionsState/index.d.ts +2 -0
  72. package/auth/SessionsState/index.js +1 -1
  73. package/auth/SessionsState/saga.js +1 -15
  74. package/auth/SignUp/index.d.ts +2 -0
  75. package/auth/SignUp/index.js +1 -1
  76. package/auth/SignUp/interfaces.js +0 -1
  77. package/auth/SignUp/saga.js +6 -15
  78. package/auth/SocialLogins/index.d.ts +2 -0
  79. package/auth/SocialLogins/index.js +1 -1
  80. package/auth/SocialLogins/saga.js +10 -20
  81. package/auth/TeamState/index.d.ts +2 -0
  82. package/auth/TeamState/index.js +1 -1
  83. package/auth/TeamState/interfaces.js +0 -1
  84. package/auth/TeamState/saga.js +85 -205
  85. package/auth/TenantsState/index.d.ts +2 -0
  86. package/auth/TenantsState/index.js +1 -1
  87. package/auth/TenantsState/saga.js +1 -17
  88. package/auth/index.d.ts +2 -2
  89. package/auth/index.js +4 -3
  90. package/auth/interfaces.d.ts +2 -1
  91. package/auth/interfaces.js +0 -6
  92. package/auth/reducer.d.ts +2 -2
  93. package/auth/reducer.js +0 -2
  94. package/auth/saga.js +2 -1
  95. package/auth/utils.d.ts +4 -0
  96. package/auth/utils.js +7 -21
  97. package/connectivity/ConnectivityState/index.d.ts +9 -0
  98. package/connectivity/ConnectivityState/index.js +1 -1
  99. package/connectivity/consts.js +0 -5
  100. package/connectivity/index.js +4 -2
  101. package/connectivity/interfaces.d.ts +1 -0
  102. package/connectivity/reducer.js +0 -2
  103. package/connectivity/saga.js +48 -85
  104. package/helpers.js +4 -7
  105. package/index.js +1 -1
  106. package/node/audits/AuditLogsState/index.js +1 -8
  107. package/node/audits/AuditLogsState/saga.js +1 -26
  108. package/node/audits/AuditsMetadataState/index.js +1 -8
  109. package/node/audits/AuditsMetadataState/saga.js +1 -10
  110. package/node/audits/backward-compatibility/index.js +0 -8
  111. package/node/audits/backward-compatibility/reducer.js +0 -5
  112. package/node/audits/backward-compatibility/saga.js +0 -23
  113. package/node/audits/dummy.js +0 -19
  114. package/node/audits/index.js +0 -14
  115. package/node/audits/initialState.js +0 -3
  116. package/node/audits/reducer.js +0 -8
  117. package/node/audits/saga.js +0 -5
  118. package/node/audits/utils.js +0 -4
  119. package/node/auth/AcceptInvitationState/index.js +1 -7
  120. package/node/auth/AcceptInvitationState/interfaces.js +0 -1
  121. package/node/auth/AcceptInvitationState/saga.js +0 -7
  122. package/node/auth/AccountSettingsState/index.js +1 -6
  123. package/node/auth/AccountSettingsState/saga.js +1 -16
  124. package/node/auth/ActivateState/index.js +1 -7
  125. package/node/auth/ActivateState/interfaces.js +0 -1
  126. package/node/auth/ActivateState/saga.js +14 -41
  127. package/node/auth/ApiTokensState/index.js +1 -6
  128. package/node/auth/ApiTokensState/interfaces.js +0 -1
  129. package/node/auth/ApiTokensState/saga.js +1 -51
  130. package/node/auth/ForgotPasswordState/index.js +1 -7
  131. package/node/auth/ForgotPasswordState/interfaces.js +0 -1
  132. package/node/auth/ForgotPasswordState/saga.js +5 -19
  133. package/node/auth/ImpersonationState/index.js +1 -7
  134. package/node/auth/ImpersonationState/interfaces.js +0 -1
  135. package/node/auth/ImpersonationState/saga.js +5 -15
  136. package/node/auth/LoginState/index.js +1 -7
  137. package/node/auth/LoginState/interfaces.js +0 -7
  138. package/node/auth/LoginState/saga.js +132 -322
  139. package/node/auth/MfaState/index.js +1 -7
  140. package/node/auth/MfaState/interfaces.js +0 -1
  141. package/node/auth/MfaState/saga.js +64 -137
  142. package/node/auth/ProfileState/index.js +1 -6
  143. package/node/auth/ProfileState/saga.js +22 -58
  144. package/node/auth/Provisioning/index.js +1 -6
  145. package/node/auth/Provisioning/saga.js +11 -28
  146. package/node/auth/ResetPhoneNumberState/index.js +1 -7
  147. package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
  148. package/node/auth/ResetPhoneNumberState/saga.js +17 -32
  149. package/node/auth/RestrictionsState/index.js +1 -7
  150. package/node/auth/RestrictionsState/saga.js +52 -109
  151. package/node/auth/RolesState/index.js +1 -6
  152. package/node/auth/RolesState/saga.js +30 -54
  153. package/node/auth/SSOState/index.js +1 -6
  154. package/node/auth/SSOState/interfaces.js +0 -3
  155. package/node/auth/SSOState/saga.js +10 -63
  156. package/node/auth/SSOState/saga.v2.js +13 -53
  157. package/node/auth/SecurityPolicyState/index.js +1 -6
  158. package/node/auth/SecurityPolicyState/saga.js +36 -89
  159. package/node/auth/SessionsPolicyState/index.js +1 -6
  160. package/node/auth/SessionsPolicyState/saga.js +7 -24
  161. package/node/auth/SessionsState/index.js +1 -6
  162. package/node/auth/SessionsState/saga.js +1 -22
  163. package/node/auth/SignUp/index.js +1 -7
  164. package/node/auth/SignUp/interfaces.js +0 -1
  165. package/node/auth/SignUp/saga.js +6 -30
  166. package/node/auth/SocialLogins/index.js +1 -6
  167. package/node/auth/SocialLogins/saga.js +10 -33
  168. package/node/auth/TeamState/index.js +1 -6
  169. package/node/auth/TeamState/interfaces.js +0 -1
  170. package/node/auth/TeamState/saga.js +86 -190
  171. package/node/auth/TenantsState/index.js +1 -6
  172. package/node/auth/TenantsState/saga.js +1 -24
  173. package/node/auth/dummy.js +0 -5
  174. package/node/auth/index.js +0 -90
  175. package/node/auth/initialState.js +0 -23
  176. package/node/auth/interfaces.js +0 -6
  177. package/node/auth/reducer.js +0 -28
  178. package/node/auth/saga.js +2 -26
  179. package/node/auth/utils.js +7 -42
  180. package/node/connectivity/ConnectivityState/index.js +1 -7
  181. package/node/connectivity/consts.js +1 -7
  182. package/node/connectivity/index.js +0 -5
  183. package/node/connectivity/reducer.js +0 -6
  184. package/node/connectivity/saga.js +47 -91
  185. package/node/helpers.js +2 -14
  186. package/node/index.js +1 -17
  187. package/node/subscriptions/Billing/Information/index.js +0 -7
  188. package/node/subscriptions/Billing/Information/saga.js +1 -25
  189. package/node/subscriptions/Billing/Invoices/index.js +0 -6
  190. package/node/subscriptions/Billing/Invoices/saga.js +1 -13
  191. package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
  192. package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
  193. package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
  194. package/node/subscriptions/Billing/Subscription/index.js +0 -6
  195. package/node/subscriptions/Billing/Subscription/saga.js +3 -23
  196. package/node/subscriptions/Billing/index.js +0 -6
  197. package/node/subscriptions/Billing/interfaces.js +0 -8
  198. package/node/subscriptions/Billing/saga.js +0 -7
  199. package/node/subscriptions/Checkout/index.js +0 -6
  200. package/node/subscriptions/Checkout/saga.js +2 -22
  201. package/node/subscriptions/Config/index.js +0 -6
  202. package/node/subscriptions/Config/saga.js +1 -12
  203. package/node/subscriptions/Plans/index.js +0 -6
  204. package/node/subscriptions/Plans/saga.js +1 -13
  205. package/node/subscriptions/Stripe/index.js +0 -6
  206. package/node/subscriptions/Stripe/saga.js +0 -8
  207. package/node/subscriptions/VendorPublicConfig/index.js +0 -6
  208. package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
  209. package/node/subscriptions/dummy.js +2 -4
  210. package/node/subscriptions/general.interfaces.js +0 -5
  211. package/node/subscriptions/index.js +0 -5
  212. package/node/subscriptions/interfaces.js +0 -14
  213. package/node/subscriptions/mapper.js +0 -11
  214. package/node/subscriptions/reducer.js +0 -9
  215. package/node/subscriptions/saga.js +0 -9
  216. package/node/subscriptions/utils.js +0 -6
  217. package/node/toolkit/index.js +0 -31
  218. package/node/toolkit/redux-saga.js +0 -3
  219. package/node/toolkit/redux.js +0 -1
  220. package/node/vendor/VendorState/index.js +1 -7
  221. package/node/vendor/index.js +0 -5
  222. package/node/vendor/reducer.js +0 -6
  223. package/node/vendor/saga.js +1 -9
  224. package/package.json +1 -1
  225. package/subscriptions/Billing/Information/index.js +0 -4
  226. package/subscriptions/Billing/Information/saga.js +1 -12
  227. package/subscriptions/Billing/Invoices/index.js +0 -4
  228. package/subscriptions/Billing/Invoices/saga.js +1 -5
  229. package/subscriptions/Billing/PaymentMethod/index.js +2 -6
  230. package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
  231. package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
  232. package/subscriptions/Billing/Subscription/index.js +0 -4
  233. package/subscriptions/Billing/Subscription/saga.js +3 -17
  234. package/subscriptions/Billing/interfaces.js +1 -0
  235. package/subscriptions/Checkout/index.js +0 -4
  236. package/subscriptions/Checkout/saga.js +2 -12
  237. package/subscriptions/Config/index.js +0 -4
  238. package/subscriptions/Config/saga.js +1 -7
  239. package/subscriptions/Plans/index.js +0 -2
  240. package/subscriptions/Plans/saga.js +1 -6
  241. package/subscriptions/Stripe/index.js +0 -4
  242. package/subscriptions/Stripe/saga.js +0 -4
  243. package/subscriptions/VendorPublicConfig/index.js +0 -2
  244. package/subscriptions/VendorPublicConfig/saga.js +1 -4
  245. package/subscriptions/dummy.js +3 -2
  246. package/subscriptions/general.interfaces.js +0 -5
  247. package/subscriptions/index.js +3 -1
  248. package/subscriptions/mapper.js +0 -5
  249. package/toolkit/index.d.ts +1 -1
  250. package/toolkit/index.js +0 -9
  251. package/vendor/VendorState/index.js +1 -0
  252. package/vendor/index.js +4 -2
  253. package/vendor/reducer.js +0 -2
  254. package/vendor/saga.js +1 -2
@@ -21,6 +21,7 @@ declare const reducers: {
21
21
  user?: import("..").User | null | undefined;
22
22
  isSSOAuth: boolean;
23
23
  ssoACS?: string | undefined;
24
+ includeQueryParam?: boolean | undefined;
24
25
  loginState: import("../LoginState/interfaces").LoginState;
25
26
  activateState: import("..").ActivateAccountState;
26
27
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -59,6 +60,7 @@ declare const reducers: {
59
60
  user?: import("..").User | null | undefined;
60
61
  isSSOAuth: boolean;
61
62
  ssoACS?: string | undefined;
63
+ includeQueryParam?: boolean | undefined;
62
64
  loginState: import("../LoginState/interfaces").LoginState;
63
65
  activateState: import("..").ActivateAccountState;
64
66
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -100,8 +102,8 @@ declare const actions: {
100
102
  deviceId: string;
101
103
  }, boolean>, string, never, never>;
102
104
  disableMfaSms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<WithDeviceId<IDisableMFASMS>, boolean>], WithCallback<WithDeviceId<IDisableMFASMS>, boolean>, string, never, never>;
103
- preEnrollMfaSms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("@frontegg/rest-api").IPreEnrollMFASMS, "mfaToken" | "phoneNumber">, boolean>], WithCallback<Pick<import("@frontegg/rest-api").IPreEnrollMFASMS, "mfaToken" | "phoneNumber">, boolean>, string, never, never>;
104
- enrollMfaSms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("@frontegg/rest-api").IEnrollMFASMS, "mfaToken" | "otcToken" | "code">, string | undefined>], WithCallback<Pick<import("@frontegg/rest-api").IEnrollMFASMS, "mfaToken" | "otcToken" | "code">, string | undefined>, string, never, never>;
105
+ preEnrollMfaSms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("@frontegg/rest-api").IPreEnrollMFASMS, "phoneNumber">, boolean>], WithCallback<Pick<import("@frontegg/rest-api").IPreEnrollMFASMS, "phoneNumber">, boolean>, string, never, never>;
106
+ enrollMfaSms: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<Pick<import("@frontegg/rest-api").IEnrollMFASMS, "otcToken" | "code">, string | undefined>], WithCallback<Pick<import("@frontegg/rest-api").IEnrollMFASMS, "otcToken" | "code">, string | undefined>, string, never, never>;
105
107
  preEnrollMfaWebAuthn: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
106
108
  callback?: ((data: IPreEnrollMFAWebAuthNForLoginResponse | null, error?: string | undefined) => void) | undefined;
107
109
  }], {
@@ -51,13 +51,13 @@ const actions = {
51
51
  payload
52
52
  }))
53
53
  };
54
+
54
55
  /**
55
56
  * To be used for actions types after dispatch, and should contains
56
57
  * the reducers and actions as standalone function
57
58
  */
58
59
 
59
60
  // noinspection JSUnusedLocalSymbols
60
-
61
61
  /**
62
62
  * if you see error in matcher that's mean the DispatchAction does not
63
63
  * contains the same functions in reducers and actions
@@ -21,8 +21,8 @@ export interface MFAState {
21
21
  mfaStrategies?: MFAStrategyEnum[];
22
22
  mfaDevices?: UserMFADevicesResponse;
23
23
  }
24
- export declare type IUserPreEnrollMFASMSPayload = WithCallback<Omit<IPreEnrollMFASMS, 'maToken' | 'rememberDevice'>>;
25
- export declare type IUserEnrollMFASMSPayload = WithCallback<Omit<IEnrollMFASMS, 'maToken' | 'rememberDevice'>, string | undefined>;
24
+ export declare type IUserPreEnrollMFASMSPayload = WithCallback<Omit<IPreEnrollMFASMS, 'mfaToken' | 'rememberDevice'>>;
25
+ export declare type IUserEnrollMFASMSPayload = WithCallback<Omit<IEnrollMFASMS, 'mfaToken' | 'rememberDevice'>, string | undefined>;
26
26
  export declare type IUserEnrollMFAWebAuthnPayload = WithCallback<Omit<IEnrollMFAWebAuthn, 'options' | 'mfaToken' | 'rememberDevice'>, string | undefined> & {
27
27
  publicKey: Credential;
28
28
  };
@@ -1,5 +1,4 @@
1
1
  export let MFAStep;
2
-
3
2
  (function (MFAStep) {
4
3
  MFAStep["verify"] = "verify";
5
4
  MFAStep["recoveryCode"] = "recoveryCode";
@@ -1,23 +1,22 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  const _excluded = ["callback"],
4
- _excluded2 = ["callback"],
5
- _excluded3 = ["callback"],
6
- _excluded4 = ["deviceId", "callback"],
7
- _excluded5 = ["deviceId", "callback"],
8
- _excluded6 = ["callback"],
9
- _excluded7 = ["deviceId"],
10
- _excluded8 = ["deviceId"],
11
- _excluded9 = ["callback"],
12
- _excluded10 = ["deviceId"],
13
- _excluded11 = ["callback"];
4
+ _excluded2 = ["callback"],
5
+ _excluded3 = ["callback"],
6
+ _excluded4 = ["deviceId", "callback"],
7
+ _excluded5 = ["deviceId", "callback"],
8
+ _excluded6 = ["callback"],
9
+ _excluded7 = ["deviceId"],
10
+ _excluded8 = ["deviceId"],
11
+ _excluded9 = ["callback"],
12
+ _excluded10 = ["deviceId"],
13
+ _excluded11 = ["callback"];
14
14
  import { call, put, select, takeEvery } from 'redux-saga/effects';
15
15
  import { api } from '@frontegg/rest-api';
16
16
  import { actions } from '../reducer';
17
17
  import { MFAStep } from './interfaces';
18
18
  import { base64urlDecode, delay, publicKeyCredentialToJSON } from '../utils';
19
19
  import { userDemo } from '../dummy';
20
-
21
20
  function* getMfaStateAfterEnroll(res) {
22
21
  const {
23
22
  step
@@ -31,12 +30,10 @@ function* getMfaStateAfterEnroll(res) {
31
30
  };
32
31
  return mfaState;
33
32
  }
34
-
35
33
  function* enrollMfa() {
36
34
  yield put(actions.setMfaState({
37
35
  saving: true
38
36
  }));
39
-
40
37
  try {
41
38
  const {
42
39
  qrCode
@@ -53,19 +50,16 @@ function* enrollMfa() {
53
50
  }));
54
51
  }
55
52
  }
56
-
57
53
  function* verifyMfa(_ref) {
58
54
  let {
59
- payload: {
60
- callback
61
- }
62
- } = _ref,
63
- payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
64
-
55
+ payload: {
56
+ callback
57
+ }
58
+ } = _ref,
59
+ payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
65
60
  yield put(actions.setMfaState({
66
61
  saving: true
67
62
  }));
68
-
69
63
  try {
70
64
  const user = yield select(state => state.auth.user);
71
65
  const data = yield call(api.auth.verifyMfa, payload);
@@ -86,19 +80,16 @@ function* verifyMfa(_ref) {
86
80
  callback == null ? void 0 : callback(null, e);
87
81
  }
88
82
  }
89
-
90
83
  function* verifyMfaAfterForce(_ref2) {
91
84
  let {
92
- payload: {
93
- callback
94
- }
95
- } = _ref2,
96
- payload = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
97
-
85
+ payload: {
86
+ callback
87
+ }
88
+ } = _ref2,
89
+ payload = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
98
90
  yield put(actions.setMfaState({
99
91
  loading: true
100
92
  }));
101
-
102
93
  try {
103
94
  const user = yield call(api.auth.loginWithMfa, payload);
104
95
  const mfaState = {
@@ -107,11 +98,9 @@ function* verifyMfaAfterForce(_ref2) {
107
98
  saving: false,
108
99
  error: undefined
109
100
  };
110
-
111
101
  if (user != null && user.recoveryCode) {
112
102
  mfaState.recoveryCode = user.recoveryCode;
113
103
  }
114
-
115
104
  yield put(actions.setMfaState(mfaState));
116
105
  yield put(actions.setState({
117
106
  user
@@ -126,17 +115,14 @@ function* verifyMfaAfterForce(_ref2) {
126
115
  callback == null ? void 0 : callback(null, e);
127
116
  }
128
117
  }
129
-
130
118
  function* disableMfa({
131
119
  payload
132
120
  }) {
133
121
  yield put(actions.setMfaState({
134
122
  saving: true
135
123
  }));
136
-
137
124
  try {
138
125
  var _payload$callback;
139
-
140
126
  yield call(api.auth.disableMfa, payload);
141
127
  const mfaDevices = yield call(api.auth.getMFADevices);
142
128
  yield put(actions.setMfaState({
@@ -147,7 +133,6 @@ function* disableMfa({
147
133
  (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
148
134
  } catch (e) {
149
135
  var _payload$callback2;
150
-
151
136
  yield put(actions.setMfaState({
152
137
  saving: false,
153
138
  error: e.message
@@ -155,19 +140,15 @@ function* disableMfa({
155
140
  (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
156
141
  }
157
142
  }
158
-
159
143
  function* preEnrollMfaWebAuthn({
160
144
  payload
161
145
  }) {
162
146
  yield put(actions.setMfaState({
163
147
  saving: true
164
148
  }));
165
-
166
149
  try {
167
150
  var _data$options$exclude, _payload$callback3;
168
-
169
151
  const data = yield call(api.auth.preEnrollMFAWebAuthn);
170
-
171
152
  const options = _extends({}, data.options, {
172
153
  challenge: base64urlDecode(data.options.challenge),
173
154
  user: _extends({}, data.options.user, {
@@ -177,7 +158,6 @@ function* preEnrollMfaWebAuthn({
177
158
  id: base64urlDecode(credentials.id)
178
159
  }))
179
160
  });
180
-
181
161
  yield put(actions.setMfaState({
182
162
  saving: false
183
163
  }));
@@ -187,7 +167,6 @@ function* preEnrollMfaWebAuthn({
187
167
  });
188
168
  } catch (e) {
189
169
  var _payload$callback4;
190
-
191
170
  yield put(actions.setMfaState({
192
171
  saving: false,
193
172
  error: e.message
@@ -195,19 +174,16 @@ function* preEnrollMfaWebAuthn({
195
174
  (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, null, e);
196
175
  }
197
176
  }
198
-
199
177
  function* enrollMfaWebAuthn(_ref3) {
200
178
  let {
201
- payload: {
202
- callback
203
- }
204
- } = _ref3,
205
- payload = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
206
-
179
+ payload: {
180
+ callback
181
+ }
182
+ } = _ref3,
183
+ payload = _objectWithoutPropertiesLoose(_ref3.payload, _excluded3);
207
184
  yield put(actions.setMfaState({
208
185
  saving: true
209
186
  }));
210
-
211
187
  try {
212
188
  const publicKey = publicKeyCredentialToJSON(payload.publicKey);
213
189
  const data = yield call(api.auth.enrollMFAWebAuthn, _extends({}, payload, {
@@ -227,32 +203,26 @@ function* enrollMfaWebAuthn(_ref3) {
227
203
  callback == null ? void 0 : callback(null, e);
228
204
  }
229
205
  }
230
-
231
206
  function* preDisableMfaWebAuthn(_ref4) {
232
207
  let {
233
- payload: {
234
- deviceId,
235
- callback
236
- }
237
- } = _ref4,
238
- payload = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
239
-
208
+ payload: {
209
+ deviceId,
210
+ callback
211
+ }
212
+ } = _ref4,
213
+ payload = _objectWithoutPropertiesLoose(_ref4.payload, _excluded4);
240
214
  yield put(actions.setMfaState({
241
215
  saving: true
242
216
  }));
243
-
244
217
  try {
245
218
  var _data$options$allowCr;
246
-
247
219
  const data = yield call(api.auth.preDisableMFAWebAuthn, deviceId);
248
-
249
220
  const options = _extends({}, data.options, {
250
221
  challenge: base64urlDecode(data.options.challenge),
251
222
  allowCredentials: (_data$options$allowCr = data.options.allowCredentials) == null ? void 0 : _data$options$allowCr.map(credentials => _extends({}, credentials, {
252
223
  id: base64urlDecode(credentials.id)
253
224
  }))
254
225
  });
255
-
256
226
  yield put(actions.setMfaState({
257
227
  saving: false
258
228
  }));
@@ -268,20 +238,17 @@ function* preDisableMfaWebAuthn(_ref4) {
268
238
  callback == null ? void 0 : callback(null, e);
269
239
  }
270
240
  }
271
-
272
241
  function* disableMfaWebAuthn(_ref5) {
273
242
  let {
274
- payload: {
275
- deviceId,
276
- callback
277
- }
278
- } = _ref5,
279
- payload = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
280
-
243
+ payload: {
244
+ deviceId,
245
+ callback
246
+ }
247
+ } = _ref5,
248
+ payload = _objectWithoutPropertiesLoose(_ref5.payload, _excluded5);
281
249
  yield put(actions.setMfaState({
282
250
  saving: true
283
251
  }));
284
-
285
252
  try {
286
253
  const publicKey = publicKeyCredentialToJSON(payload.publicKey);
287
254
  yield call(api.auth.disableMFAWebAuthn, deviceId, _extends({}, payload, {
@@ -302,17 +269,14 @@ function* disableMfaWebAuthn(_ref5) {
302
269
  callback == null ? void 0 : callback(false, e);
303
270
  }
304
271
  }
305
-
306
272
  function* preEnrollMfaSms({
307
273
  payload
308
274
  }) {
309
275
  yield put(actions.setMfaState({
310
276
  saving: true
311
277
  }));
312
-
313
278
  try {
314
279
  var _payload$callback5;
315
-
316
280
  const res = yield call(api.auth.preEnrollMFASMS, payload);
317
281
  yield put(actions.setMfaState({
318
282
  saving: false,
@@ -323,7 +287,6 @@ function* preEnrollMfaSms({
323
287
  (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, true);
324
288
  } catch (e) {
325
289
  var _payload$callback6;
326
-
327
290
  yield put(actions.setMfaState({
328
291
  saving: false,
329
292
  error: e.message
@@ -331,19 +294,16 @@ function* preEnrollMfaSms({
331
294
  (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, false, e);
332
295
  }
333
296
  }
334
-
335
297
  function* enrollMfaSms(_ref6) {
336
298
  let {
337
- payload: {
338
- callback
339
- }
340
- } = _ref6,
341
- payload = _objectWithoutPropertiesLoose(_ref6.payload, _excluded6);
342
-
299
+ payload: {
300
+ callback
301
+ }
302
+ } = _ref6,
303
+ payload = _objectWithoutPropertiesLoose(_ref6.payload, _excluded6);
343
304
  yield put(actions.setMfaState({
344
305
  saving: true
345
306
  }));
346
-
347
307
  try {
348
308
  const data = yield call(api.auth.enrollMFASMS, payload);
349
309
  const mfaDevices = yield call(api.auth.getMFADevices);
@@ -360,22 +320,18 @@ function* enrollMfaSms(_ref6) {
360
320
  callback == null ? void 0 : callback(null, e);
361
321
  }
362
322
  }
363
-
364
323
  function* preDisableMfaSms(_ref7) {
365
324
  let {
366
- payload: {
367
- deviceId
368
- }
369
- } = _ref7,
370
- payload = _objectWithoutPropertiesLoose(_ref7.payload, _excluded7);
371
-
325
+ payload: {
326
+ deviceId
327
+ }
328
+ } = _ref7,
329
+ payload = _objectWithoutPropertiesLoose(_ref7.payload, _excluded7);
372
330
  yield put(actions.setMfaState({
373
331
  saving: true
374
332
  }));
375
-
376
333
  try {
377
334
  var _payload$callback7;
378
-
379
335
  const res = yield call(api.auth.preDisableMFASMS, deviceId);
380
336
  yield put(actions.setMfaState({
381
337
  saving: false,
@@ -386,7 +342,6 @@ function* preDisableMfaSms(_ref7) {
386
342
  (_payload$callback7 = payload.callback) == null ? void 0 : _payload$callback7.call(payload, true);
387
343
  } catch (e) {
388
344
  var _payload$callback8;
389
-
390
345
  yield put(actions.setMfaState({
391
346
  saving: false,
392
347
  error: e.message
@@ -394,22 +349,18 @@ function* preDisableMfaSms(_ref7) {
394
349
  (_payload$callback8 = payload.callback) == null ? void 0 : _payload$callback8.call(payload, false, e);
395
350
  }
396
351
  }
397
-
398
352
  function* disableMfaSms(_ref8) {
399
353
  let {
400
- payload: {
401
- deviceId
402
- }
403
- } = _ref8,
404
- payload = _objectWithoutPropertiesLoose(_ref8.payload, _excluded8);
405
-
354
+ payload: {
355
+ deviceId
356
+ }
357
+ } = _ref8,
358
+ payload = _objectWithoutPropertiesLoose(_ref8.payload, _excluded8);
406
359
  yield put(actions.setMfaState({
407
360
  saving: true
408
361
  }));
409
-
410
362
  try {
411
363
  var _payload$callback9;
412
-
413
364
  yield call(api.auth.disableMFASMS, deviceId, payload);
414
365
  const mfaDevices = yield call(api.auth.getMFADevices);
415
366
  yield put(actions.setMfaState({
@@ -420,7 +371,6 @@ function* disableMfaSms(_ref8) {
420
371
  (_payload$callback9 = payload.callback) == null ? void 0 : _payload$callback9.call(payload, true);
421
372
  } catch (e) {
422
373
  var _payload$callback10;
423
-
424
374
  yield put(actions.setMfaState({
425
375
  saving: false,
426
376
  error: e.message
@@ -428,12 +378,10 @@ function* disableMfaSms(_ref8) {
428
378
  (_payload$callback10 = payload.callback) == null ? void 0 : _payload$callback10.call(payload, false, e);
429
379
  }
430
380
  }
431
-
432
381
  function* getMFADevices() {
433
382
  yield put(actions.setMfaState({
434
383
  loading: true
435
384
  }));
436
-
437
385
  try {
438
386
  const user = yield select(state => state.auth.user);
439
387
  const mfaDevices = yield call(api.auth.getMFADevices);
@@ -449,12 +397,10 @@ function* getMFADevices() {
449
397
  }));
450
398
  }
451
399
  }
452
-
453
400
  function* getMFAStrategies() {
454
401
  yield put(actions.setMfaState({
455
402
  loading: true
456
403
  }));
457
-
458
404
  try {
459
405
  const res = yield call(api.auth.getMFAStrategiesConfig);
460
406
  const mfaStrategies = res.strategies.filter(({
@@ -474,7 +420,6 @@ function* getMFAStrategies() {
474
420
  }));
475
421
  }
476
422
  }
477
-
478
423
  export function* mfaSagas() {
479
424
  yield takeEvery(actions.enrollMfa, enrollMfa);
480
425
  yield takeEvery(actions.getMFADevices, getMFADevices);
@@ -491,6 +436,7 @@ export function* mfaSagas() {
491
436
  yield takeEvery(actions.preDisableMfaWebAuthn, preDisableMfaWebAuthn);
492
437
  yield takeEvery(actions.disableMfaWebAuthn, disableMfaWebAuthn);
493
438
  }
439
+
494
440
  /*********************************
495
441
  * Preview Sagas
496
442
  *********************************/
@@ -506,7 +452,6 @@ function* enrollMfaMock() {
506
452
  qrCode
507
453
  }));
508
454
  }
509
-
510
455
  function* verifyMfaMock({
511
456
  payload: {
512
457
  callback
@@ -538,46 +483,38 @@ function* verifyMfaMock({
538
483
  }]
539
484
  })
540
485
  };
541
-
542
486
  if (data != null && data.recoveryCode) {
543
487
  mfaState.recoveryCode = data.recoveryCode;
544
488
  }
545
-
546
489
  yield put(actions.setMfaState(mfaState));
547
490
  yield put(actions.setUser(_extends({}, userDemo, {
548
491
  mfaEnrolled: true
549
492
  })));
550
493
  callback == null ? void 0 : callback(mfaState.recoveryCode);
551
494
  }
552
-
553
495
  function* verifyMfaAfterForceMock(_ref9) {
554
496
  let {
555
- payload: {
556
- callback
557
- }
558
- } = _ref9,
559
- payload = _objectWithoutPropertiesLoose(_ref9.payload, _excluded9);
560
-
497
+ payload: {
498
+ callback
499
+ }
500
+ } = _ref9,
501
+ payload = _objectWithoutPropertiesLoose(_ref9.payload, _excluded9);
561
502
  yield put(actions.setMfaState({
562
503
  loading: true
563
504
  }));
564
505
  yield delay();
565
-
566
506
  const data = _extends({}, payload, {
567
507
  recoveryCode: 'recoveryCode'
568
508
  });
569
-
570
509
  const mfaState = {
571
510
  step: MFAStep.recoveryCode,
572
511
  loading: false,
573
512
  error: undefined,
574
513
  saving: false
575
514
  };
576
-
577
515
  if (data != null && data.recoveryCode) {
578
516
  mfaState.recoveryCode = data.recoveryCode;
579
517
  }
580
-
581
518
  yield put(actions.setMfaState(mfaState));
582
519
  yield delay();
583
520
  yield put(actions.setUser(_extends({}, userDemo, {
@@ -585,12 +522,10 @@ function* verifyMfaAfterForceMock(_ref9) {
585
522
  })));
586
523
  callback == null ? void 0 : callback(mfaState.recoveryCode);
587
524
  }
588
-
589
525
  function* disableMfaMock({
590
526
  payload
591
527
  }) {
592
528
  var _payload$callback11;
593
-
594
529
  const {
595
530
  mfaDevices = {
596
531
  webauthn: [],
@@ -612,18 +547,14 @@ function* disableMfaMock({
612
547
  yield put(actions.setUser(_extends({}, userDemo)));
613
548
  (_payload$callback11 = payload.callback) == null ? void 0 : _payload$callback11.call(payload, true);
614
549
  }
615
-
616
550
  function* preDisableMfaSmsMock(_ref10) {
617
551
  let {} = _ref10,
618
- payload = _objectWithoutPropertiesLoose(_ref10.payload, _excluded10);
619
-
552
+ payload = _objectWithoutPropertiesLoose(_ref10.payload, _excluded10);
620
553
  yield put(actions.setMfaState({
621
554
  saving: true
622
555
  }));
623
-
624
556
  try {
625
557
  var _payload$callback12;
626
-
627
558
  yield put(actions.setMfaState({
628
559
  saving: false,
629
560
  error: undefined,
@@ -633,7 +564,6 @@ function* preDisableMfaSmsMock(_ref10) {
633
564
  (_payload$callback12 = payload.callback) == null ? void 0 : _payload$callback12.call(payload, true);
634
565
  } catch (e) {
635
566
  var _payload$callback13;
636
-
637
567
  yield put(actions.setMfaState({
638
568
  saving: false,
639
569
  error: e.message
@@ -641,12 +571,10 @@ function* preDisableMfaSmsMock(_ref10) {
641
571
  (_payload$callback13 = payload.callback) == null ? void 0 : _payload$callback13.call(payload, false, e);
642
572
  }
643
573
  }
644
-
645
574
  function* disableMfaSmsMock({
646
575
  payload
647
576
  }) {
648
577
  var _payload$callback14;
649
-
650
578
  const {
651
579
  mfaDevices = {
652
580
  webauthn: [],
@@ -668,12 +596,10 @@ function* disableMfaSmsMock({
668
596
  yield put(actions.setUser(_extends({}, userDemo)));
669
597
  (_payload$callback14 = payload.callback) == null ? void 0 : _payload$callback14.call(payload, true);
670
598
  }
671
-
672
599
  function* preEnrollMfaSmsMock({
673
600
  payload
674
601
  }) {
675
602
  var _payload$callback15;
676
-
677
603
  yield put(actions.setMfaState({
678
604
  saving: true
679
605
  }));
@@ -686,15 +612,13 @@ function* preEnrollMfaSmsMock({
686
612
  }));
687
613
  (_payload$callback15 = payload.callback) == null ? void 0 : _payload$callback15.call(payload, true);
688
614
  }
689
-
690
615
  function* enrollMfaSmsMock(_ref11) {
691
616
  let {
692
- payload: {
693
- callback
694
- }
695
- } = _ref11,
696
- payload = _objectWithoutPropertiesLoose(_ref11.payload, _excluded11);
697
-
617
+ payload: {
618
+ callback
619
+ }
620
+ } = _ref11,
621
+ payload = _objectWithoutPropertiesLoose(_ref11.payload, _excluded11);
698
622
  const {
699
623
  mfaDevices = {
700
624
  webauthn: [],
@@ -722,18 +646,15 @@ function* enrollMfaSmsMock(_ref11) {
722
646
  }]
723
647
  })
724
648
  };
725
-
726
649
  if (data != null && data.recoveryCode) {
727
650
  mfaState.recoveryCode = data.recoveryCode;
728
651
  }
729
-
730
652
  yield put(actions.setMfaState(mfaState));
731
653
  yield put(actions.setUser(_extends({}, userDemo, {
732
654
  mfaEnrolled: true
733
655
  })));
734
656
  callback == null ? void 0 : callback(mfaState.recoveryCode);
735
657
  }
736
-
737
658
  export function* mfaSagasMock() {
738
659
  yield takeEvery(actions.enrollMfa, enrollMfaMock);
739
660
  yield takeEvery(actions.verifyMfa, verifyMfaMock);
@@ -20,6 +20,7 @@ declare const reducers: {
20
20
  user?: import("..").User | null | undefined;
21
21
  isSSOAuth: boolean;
22
22
  ssoACS?: string | undefined;
23
+ includeQueryParam?: boolean | undefined;
23
24
  loginState: import("..").LoginState;
24
25
  activateState: import("..").ActivateAccountState;
25
26
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -58,6 +59,7 @@ declare const reducers: {
58
59
  user?: import("..").User | null | undefined;
59
60
  isSSOAuth: boolean;
60
61
  ssoACS?: string | undefined;
62
+ includeQueryParam?: boolean | undefined;
61
63
  loginState: import("..").LoginState;
62
64
  activateState: import("..").ActivateAccountState;
63
65
  acceptInvitationState: import("..").AcceptInvitationState;
@@ -20,13 +20,13 @@ const actions = {
20
20
  payload
21
21
  }))
22
22
  };
23
+
23
24
  /**
24
25
  * To be used for actions types after dispatch, and should contains
25
26
  * the reducers and actions as standalone function
26
27
  */
27
28
 
28
29
  // noinspection JSUnusedLocalSymbols
29
-
30
30
  /**
31
31
  * if you see error in matcher that's mean the DispatchAction does not
32
32
  * contains the same functions in reducers and actions