@frontegg/redux-store 7.89.0 → 7.90.0-alpha.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.
@@ -2,6 +2,7 @@ import type { IGetUserPasswordConfig } from '@frontegg/rest-api';
2
2
  import type { FronteggState, RestApi, SharedActions } from '../../interfaces';
3
3
  import type { ForgotPasswordState, IForgotPasswordPayload, IResetPasswordPayload, IDeterminePasswordRecoveryStrategyPayload, IVerifyPasswordViaSmsPayload } from './interfaces';
4
4
  declare const _default: (store: FronteggState, api: RestApi, sharedActions: SharedActions) => {
5
+ loadPasswordRecoveryStrategies: () => Promise<void>;
5
6
  setForgotPasswordState: (payload: Partial<ForgotPasswordState>) => void;
6
7
  resetForgotPasswordState: () => void;
7
8
  forgotPassword: (payload: IForgotPasswordPayload) => Promise<void>;
@@ -6,6 +6,23 @@ import { initialState } from './state';
6
6
  import { errorHandler, deepResetState } from '../../helpers';
7
7
  export default ((store, api, sharedActions) => {
8
8
  const actions = sharedActions;
9
+ const loadPasswordRecoveryStrategies = async () => {
10
+ setForgotPasswordState({
11
+ loading: true
12
+ });
13
+ try {
14
+ const strategies = await api.auth.getPasswordRecoveryStrategies();
15
+ setForgotPasswordState({
16
+ loading: false,
17
+ activeStrategies: strategies
18
+ });
19
+ } catch (e) {
20
+ setForgotPasswordState({
21
+ loading: false,
22
+ error: errorHandler(e)
23
+ });
24
+ }
25
+ };
9
26
  const setForgotPasswordState = payload => {
10
27
  Object.assign(store.auth.forgotPasswordState, payload);
11
28
  };
@@ -204,6 +221,7 @@ export default ((store, api, sharedActions) => {
204
221
  }
205
222
  };
206
223
  return {
224
+ loadPasswordRecoveryStrategies,
207
225
  setForgotPasswordState,
208
226
  resetForgotPasswordState,
209
227
  forgotPassword,
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.89.0
1
+ /** @license Frontegg v7.90.0-alpha.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -1,6 +1,7 @@
1
1
  import { FronteggState, RestApi, SharedActions } from '../../interfaces';
2
2
  import type { IGetUserPasswordConfig } from '@frontegg/rest-api';
3
3
  declare const _default: (store: FronteggState, api: RestApi, actions: SharedActions) => {
4
+ loadPasswordRecoveryStrategies: () => Promise<void>;
4
5
  setForgotPasswordState: (payload: Partial<import("../..").ForgotPasswordState>) => void;
5
6
  resetForgotPasswordState: () => void;
6
7
  forgotPassword: (payload: import("../..").IForgotPasswordPayload) => Promise<void>;
@@ -13,6 +13,23 @@ var _helpers = require("../../helpers");
13
13
  const _excluded = ["callback"];
14
14
  var _default = (store, api, sharedActions) => {
15
15
  const actions = sharedActions;
16
+ const loadPasswordRecoveryStrategies = async () => {
17
+ setForgotPasswordState({
18
+ loading: true
19
+ });
20
+ try {
21
+ const strategies = await api.auth.getPasswordRecoveryStrategies();
22
+ setForgotPasswordState({
23
+ loading: false,
24
+ activeStrategies: strategies
25
+ });
26
+ } catch (e) {
27
+ setForgotPasswordState({
28
+ loading: false,
29
+ error: (0, _helpers.errorHandler)(e)
30
+ });
31
+ }
32
+ };
16
33
  const setForgotPasswordState = payload => {
17
34
  Object.assign(store.auth.forgotPasswordState, payload);
18
35
  };
@@ -211,6 +228,7 @@ var _default = (store, api, sharedActions) => {
211
228
  }
212
229
  };
213
230
  return {
231
+ loadPasswordRecoveryStrategies,
214
232
  setForgotPasswordState,
215
233
  resetForgotPasswordState,
216
234
  forgotPassword,
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.89.0
1
+ /** @license Frontegg v7.90.0-alpha.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "7.89.0",
3
+ "version": "7.90.0-alpha.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
9
  "@frontegg/entitlements-javascript-commons": "1.1.2",
10
- "@frontegg/rest-api": "7.89.0",
10
+ "@frontegg/rest-api": "7.90.0-alpha.0",
11
11
  "fast-deep-equal": "3.1.3",
12
12
  "get-value": "^3.0.1",
13
13
  "proxy-compare": "^3.0.0",