@frontegg/redux-store 5.13.0 → 5.14.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.
@@ -105,7 +105,7 @@ declare const reducers: {
105
105
  };
106
106
  };
107
107
  declare const actions: {
108
- activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IActivateAccount], IActivateAccount, string, never, never>;
108
+ activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IActivateAccount, boolean>], WithCallback<IActivateAccount, boolean>, string, never, never>;
109
109
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>], WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>, string, never, never>;
110
110
  resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IResendActivationEmail], IResendActivationEmail, string, never, never>;
111
111
  };
@@ -117,7 +117,7 @@ declare type DispatchedActions = {
117
117
  setActivateState: (state: Partial<ActivateAccountState>) => void;
118
118
  resetActivateState: () => void;
119
119
  setActivateStrategyState: (state: Partial<ActivateAccountStrategyState>) => void;
120
- activateAccount: (payload: IActivateAccount) => void;
120
+ activateAccount: (payload: WithCallback<IActivateAccount>) => void;
121
121
  resendActivationEmail: (payload: IResendActivationEmail) => void;
122
122
  getActivateAccountStrategy: (payload: WithCallback<IGetActivateAccountStrategy, IGetActivateAccountStrategyResponse>) => void;
123
123
  };
@@ -82,7 +82,7 @@ declare const actions: {
82
82
  invitationToken?: string | undefined;
83
83
  }, void>, string, never, never>;
84
84
  postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IPostLogin], IPostLogin, string, never, never>;
85
- login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ILogin], ILogin, string, never, never>;
85
+ login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ILogin, boolean>], WithCallback<ILogin, boolean>, string, never, never>;
86
86
  loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ILoginWithMfa, boolean>], WithCallback<ILoginWithMfa, boolean>, string, never, never>;
87
87
  recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IRecoverMFAToken], IRecoverMFAToken, string, never, never>;
88
88
  logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
@@ -93,7 +93,7 @@ declare const actions: {
93
93
  mfaToken: string;
94
94
  }, string, never, never>;
95
95
  passwordlessPreLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IPasswordlessPreLogin, void>], WithCallback<IPasswordlessPreLogin, void>, string, never, never>;
96
- passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IPasswordlessPostLogin], IPasswordlessPostLogin, string, never, never>;
96
+ passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<IPasswordlessPostLogin, boolean>], WithCallback<IPasswordlessPostLogin, boolean>, string, never, never>;
97
97
  verifyInviteToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IVerifyInviteToken], IVerifyInviteToken, string, never, never>;
98
98
  };
99
99
  /**
@@ -112,7 +112,7 @@ declare type DispatchedActions = {
112
112
  invitationToken?: string;
113
113
  }, void>) => void;
114
114
  postLogin: (payload: IPostLogin) => void;
115
- login: (payload: ILogin) => void;
115
+ login: (payload: WithCallback<ILogin>) => void;
116
116
  loginWithMfa: (payload: WithCallback<ILoginWithMfa>) => void;
117
117
  recoverMfa: (payload: IRecoverMFAToken) => void;
118
118
  logout: (payload?: () => void) => void;
@@ -121,7 +121,7 @@ declare type DispatchedActions = {
121
121
  mfaToken: string;
122
122
  }) => void;
123
123
  passwordlessPreLogin: (payload: IPasswordlessPreLogin) => void;
124
- passwordlessPostLogin: (payload: IPasswordlessPostLogin) => void;
124
+ passwordlessPostLogin: (payload: WithCallback<IPasswordlessPostLogin>) => void;
125
125
  verifyInviteToken: (payload: IVerifyInviteToken) => void;
126
126
  };
127
127
  export declare type LoginActions = DispatchedActions;
package/auth/index.d.ts CHANGED
@@ -222,7 +222,7 @@ declare const _default: {
222
222
  resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IResetPassword, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IResetPassword, boolean>, string, never, never>;
223
223
  loadPasswordConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("@frontegg/rest-api").IGetUserPasswordConfig | undefined)?], import("@frontegg/rest-api").IGetUserPasswordConfig | undefined, string, never, never>;
224
224
  acceptInvitation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IAcceptInvitation], import("@frontegg/rest-api").IAcceptInvitation, string, never, never>;
225
- activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IActivateAccount], import("@frontegg/rest-api").IActivateAccount, string, never, never>;
225
+ activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IActivateAccount, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IActivateAccount, boolean>, string, never, never>;
226
226
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
227
227
  resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IResendActivationEmail], import("@frontegg/rest-api").IResendActivationEmail, string, never, never>;
228
228
  loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -241,7 +241,7 @@ declare const _default: {
241
241
  invitationToken?: string | undefined;
242
242
  }, void>, string, never, never>;
243
243
  postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
244
- login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ILogin], import("@frontegg/rest-api").ILogin, string, never, never>;
244
+ login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILogin, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILogin, boolean>, string, never, never>;
245
245
  loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
246
246
  recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IRecoverMFAToken], import("@frontegg/rest-api").IRecoverMFAToken, string, never, never>;
247
247
  logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
@@ -252,7 +252,7 @@ declare const _default: {
252
252
  mfaToken: string;
253
253
  }, string, never, never>;
254
254
  passwordlessPreLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPreLogin, void>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPreLogin, void>, string, never, never>;
255
- passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPasswordlessPostLogin], import("@frontegg/rest-api").IPasswordlessPostLogin, string, never, never>;
255
+ passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPostLogin, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPostLogin, boolean>, string, never, never>;
256
256
  verifyInviteToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IVerifyInviteToken], import("@frontegg/rest-api").IVerifyInviteToken, string, never, never>;
257
257
  setRolesState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import("./RolesState/interfaces").RolesState>], Partial<import("./RolesState/interfaces").RolesState>, string, never, never>;
258
258
  resetRolesState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
package/auth/index.js CHANGED
@@ -1001,8 +1001,9 @@ function* passwordlessPreLogin(_a) {
1001
1001
  callback === null || callback === void 0 ? void 0 : callback();
1002
1002
  }
1003
1003
  }
1004
- function* passwordlessPostLogin({ payload }) {
1005
- var _a;
1004
+ function* passwordlessPostLogin(_a) {
1005
+ var _b;
1006
+ var _c = _a.payload, { callback } = _c, payload = __rest(_c, ["callback"]);
1006
1007
  try {
1007
1008
  yield put(actions.setLoginState({ loading: true }));
1008
1009
  const data = yield call(api.auth.passwordlessPostLogin, payload);
@@ -1019,9 +1020,10 @@ function* passwordlessPostLogin({ payload }) {
1019
1020
  yield put(actions.setState({ user, isAuthenticated: true }));
1020
1021
  yield afterAuthNavigation();
1021
1022
  }
1023
+ callback === null || callback === void 0 ? void 0 : callback(true);
1022
1024
  }
1023
1025
  catch (e) {
1024
- yield put(actions.setLoginState({ error: (_a = e.message) !== null && _a !== void 0 ? _a : 'Failed to authenticate' }));
1026
+ yield put(actions.setLoginState({ error: (_b = e.message) !== null && _b !== void 0 ? _b : 'Failed to authenticate' }));
1025
1027
  }
1026
1028
  finally {
1027
1029
  yield put(actions.setLoginState({ loading: false }));
@@ -1105,7 +1107,7 @@ function* postLogin({ payload }) {
1105
1107
  yield put(actions.setLoginState({ step: LoginStep.loginWithSSOFailed, loading: false }));
1106
1108
  }
1107
1109
  }
1108
- function* login({ payload: { email, password, recaptchaToken, invitationToken } }) {
1110
+ function* login({ payload: { email, password, recaptchaToken, invitationToken, callback } }) {
1109
1111
  yield put(actions.setLoginState({ loading: true }));
1110
1112
  try {
1111
1113
  const user = yield call(api.auth.login, {
@@ -1155,6 +1157,7 @@ function* login({ payload: { email, password, recaptchaToken, invitationToken }
1155
1157
  yield put(actions.loadTenants());
1156
1158
  yield afterAuthNavigation();
1157
1159
  }
1160
+ callback === null || callback === void 0 ? void 0 : callback(true);
1158
1161
  }
1159
1162
  catch (e) {
1160
1163
  ContextHolder.setAccessToken(null);
@@ -2107,7 +2110,8 @@ function* forgotPasswordSagas() {
2107
2110
  yield takeLeading(actions.loadPasswordConfig, loadPasswordConfig);
2108
2111
  }
2109
2112
 
2110
- function* activateAccount({ payload }) {
2113
+ function* activateAccount(_a) {
2114
+ var _b = _a.payload, { callback } = _b, payload = __rest(_b, ["callback"]);
2111
2115
  yield put(actions.setActivateState({ loading: true }));
2112
2116
  try {
2113
2117
  const onRedirectTo = ContextHolder.onRedirectTo;
@@ -2128,6 +2132,7 @@ function* activateAccount({ payload }) {
2128
2132
  yield put(actions.setState({ user, isAuthenticated: true }));
2129
2133
  yield afterAuthNavigation();
2130
2134
  }
2135
+ callback === null || callback === void 0 ? void 0 : callback(true);
2131
2136
  }
2132
2137
  catch (e) {
2133
2138
  yield put(actions.setActivateState({ loading: false, error: e.message }));
package/auth/reducer.d.ts CHANGED
@@ -196,7 +196,7 @@ declare const actions: {
196
196
  resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IResetPassword, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IResetPassword, boolean>, string, never, never>;
197
197
  loadPasswordConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("@frontegg/rest-api").IGetUserPasswordConfig | undefined)?], import("@frontegg/rest-api").IGetUserPasswordConfig | undefined, string, never, never>;
198
198
  acceptInvitation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IAcceptInvitation], import("@frontegg/rest-api").IAcceptInvitation, string, never, never>;
199
- activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IActivateAccount], import("@frontegg/rest-api").IActivateAccount, string, never, never>;
199
+ activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IActivateAccount, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IActivateAccount, boolean>, string, never, never>;
200
200
  getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
201
201
  resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IResendActivationEmail], import("@frontegg/rest-api").IResendActivationEmail, string, never, never>;
202
202
  loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -215,7 +215,7 @@ declare const actions: {
215
215
  invitationToken?: string | undefined;
216
216
  }, void>, string, never, never>;
217
217
  postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
218
- login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ILogin], import("@frontegg/rest-api").ILogin, string, never, never>;
218
+ login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILogin, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILogin, boolean>, string, never, never>;
219
219
  loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
220
220
  recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IRecoverMFAToken], import("@frontegg/rest-api").IRecoverMFAToken, string, never, never>;
221
221
  logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
@@ -226,7 +226,7 @@ declare const actions: {
226
226
  mfaToken: string;
227
227
  }, string, never, never>;
228
228
  passwordlessPreLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPreLogin, void>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPreLogin, void>, string, never, never>;
229
- passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPasswordlessPostLogin], import("@frontegg/rest-api").IPasswordlessPostLogin, string, never, never>;
229
+ passwordlessPostLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPostLogin, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").IPasswordlessPostLogin, boolean>, string, never, never>;
230
230
  verifyInviteToken: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IVerifyInviteToken], import("@frontegg/rest-api").IVerifyInviteToken, string, never, never>;
231
231
  setRolesState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").RolesState>], Partial<import(".").RolesState>, string, never, never>;
232
232
  resetRolesState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
@@ -1003,8 +1003,9 @@ function* passwordlessPreLogin(_a) {
1003
1003
  callback === null || callback === void 0 ? void 0 : callback();
1004
1004
  }
1005
1005
  }
1006
- function* passwordlessPostLogin({ payload }) {
1007
- var _a;
1006
+ function* passwordlessPostLogin(_a) {
1007
+ var _b;
1008
+ var _c = _a.payload, { callback } = _c, payload = tslib.__rest(_c, ["callback"]);
1008
1009
  try {
1009
1010
  yield effects.put(actions.setLoginState({ loading: true }));
1010
1011
  const data = yield effects.call(restApi.api.auth.passwordlessPostLogin, payload);
@@ -1021,9 +1022,10 @@ function* passwordlessPostLogin({ payload }) {
1021
1022
  yield effects.put(actions.setState({ user, isAuthenticated: true }));
1022
1023
  yield afterAuthNavigation();
1023
1024
  }
1025
+ callback === null || callback === void 0 ? void 0 : callback(true);
1024
1026
  }
1025
1027
  catch (e) {
1026
- yield effects.put(actions.setLoginState({ error: (_a = e.message) !== null && _a !== void 0 ? _a : 'Failed to authenticate' }));
1028
+ yield effects.put(actions.setLoginState({ error: (_b = e.message) !== null && _b !== void 0 ? _b : 'Failed to authenticate' }));
1027
1029
  }
1028
1030
  finally {
1029
1031
  yield effects.put(actions.setLoginState({ loading: false }));
@@ -1107,7 +1109,7 @@ function* postLogin({ payload }) {
1107
1109
  yield effects.put(actions.setLoginState({ step: exports.LoginStep.loginWithSSOFailed, loading: false }));
1108
1110
  }
1109
1111
  }
1110
- function* login({ payload: { email, password, recaptchaToken, invitationToken } }) {
1112
+ function* login({ payload: { email, password, recaptchaToken, invitationToken, callback } }) {
1111
1113
  yield effects.put(actions.setLoginState({ loading: true }));
1112
1114
  try {
1113
1115
  const user = yield effects.call(restApi.api.auth.login, {
@@ -1157,6 +1159,7 @@ function* login({ payload: { email, password, recaptchaToken, invitationToken }
1157
1159
  yield effects.put(actions.loadTenants());
1158
1160
  yield afterAuthNavigation();
1159
1161
  }
1162
+ callback === null || callback === void 0 ? void 0 : callback(true);
1160
1163
  }
1161
1164
  catch (e) {
1162
1165
  restApi.ContextHolder.setAccessToken(null);
@@ -2109,7 +2112,8 @@ function* forgotPasswordSagas() {
2109
2112
  yield effects.takeLeading(actions.loadPasswordConfig, loadPasswordConfig);
2110
2113
  }
2111
2114
 
2112
- function* activateAccount({ payload }) {
2115
+ function* activateAccount(_a) {
2116
+ var _b = _a.payload, { callback } = _b, payload = tslib.__rest(_b, ["callback"]);
2113
2117
  yield effects.put(actions.setActivateState({ loading: true }));
2114
2118
  try {
2115
2119
  const onRedirectTo = restApi.ContextHolder.onRedirectTo;
@@ -2130,6 +2134,7 @@ function* activateAccount({ payload }) {
2130
2134
  yield effects.put(actions.setState({ user, isAuthenticated: true }));
2131
2135
  yield afterAuthNavigation();
2132
2136
  }
2137
+ callback === null || callback === void 0 ? void 0 : callback(true);
2133
2138
  }
2134
2139
  catch (e) {
2135
2140
  yield effects.put(actions.setActivateState({ loading: false, error: e.message }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
3
  "libName": "FronteggReduxStore",
4
- "version": "5.13.0",
4
+ "version": "5.14.0",
5
5
  "author": "Frontegg LTD",
6
6
  "main": "./node/index.js",
7
7
  "module": "./index.js",