@frontegg/redux-store 5.50.0 → 5.51.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.
package/auth/index.js CHANGED
@@ -977,9 +977,16 @@ function* refreshToken() {
977
977
  else {
978
978
  yield put(actions.setTenantsState({ tenants, loading: false }));
979
979
  yield put(actions.setState({ user, isAuthenticated: true }));
980
- if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl]
981
- .some(url => url && window.location.pathname.endsWith(url))) {
982
- if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
980
+ if ([
981
+ routes.loginUrl,
982
+ routes.socialLoginCallbackUrl,
983
+ routes.signUpUrl,
984
+ routes.oidcRedirectUrl,
985
+ routes.samlCallbackUrl,
986
+ ].some((url) => url && window.location.pathname.endsWith(url))) {
987
+ if (loginState.isNewUser &&
988
+ routes.signUpSuccessUrl &&
989
+ routes.socialLoginCallbackUrl === window.location.pathname) {
983
990
  onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
984
991
  }
985
992
  else {
@@ -1174,14 +1181,14 @@ function* verifyInviteToken({ payload }) {
1174
1181
  yield put(actions.setLoginState({ loading: false }));
1175
1182
  }
1176
1183
  }
1177
- function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback, }, }) {
1184
+ function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback }, }) {
1178
1185
  yield put(actions.setLoginState({ loading: true }));
1179
1186
  try {
1180
1187
  const onRedirectTo = yield select(({ auth: { onRedirectTo } }) => onRedirectTo);
1181
1188
  let { address, idpType } = yield call(api.auth.preLoginV2, { email });
1182
1189
  if (address) {
1183
1190
  if (idpType === SamlVendors.Oidc && !address.includes('redirect_uri')) {
1184
- const { routes: { oidcRedirectUrl } } = yield select(({ auth: { routes } }) => ({ routes }));
1191
+ const { routes: { oidcRedirectUrl }, } = yield select(({ auth: { routes } }) => ({ routes }));
1185
1192
  address += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
1186
1193
  }
1187
1194
  yield put(actions.setLoginState({ step: LoginStep.redirectToSSO, loading: false, ssoRedirectUrl: address }));
@@ -1199,7 +1206,7 @@ function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback
1199
1206
  }
1200
1207
  function* ssoPreloginFailed(_a) {
1201
1208
  var { callback } = _a, body = __rest(_a, ["callback"]);
1202
- const publicPolicy = yield select(({ auth: { securityPolicyState: { publicPolicy: { policy: publicPolicy } } } }) => publicPolicy);
1209
+ const publicPolicy = yield select(({ auth: { securityPolicyState: { publicPolicy: { policy: publicPolicy }, }, }, }) => publicPolicy);
1203
1210
  if (!(publicPolicy === null || publicPolicy === void 0 ? void 0 : publicPolicy.authStrategy)) {
1204
1211
  yield put(actions.setLoginState({ step: LoginStep.loginWithPassword, loading: false }));
1205
1212
  callback === null || callback === void 0 ? void 0 : callback();
@@ -1237,7 +1244,7 @@ function* postLogin({ payload }) {
1237
1244
  yield put(actions.setLoginState({ step: LoginStep.loginWithSSOFailed, loading: false }));
1238
1245
  }
1239
1246
  }
1240
- function* login({ payload: { email, password, recaptchaToken, invitationToken, callback, }, }) {
1247
+ function* login({ payload: { email, password, recaptchaToken, invitationToken, callback }, }) {
1241
1248
  yield put(actions.setLoginState({ loading: true }));
1242
1249
  try {
1243
1250
  const user = yield call(api.auth.login, {
@@ -1336,8 +1343,7 @@ function* logout({ payload }) {
1336
1343
  try {
1337
1344
  yield call(api.auth.logout);
1338
1345
  }
1339
- catch (_a) {
1340
- }
1346
+ catch (_a) { }
1341
1347
  yield put(actions.resetState());
1342
1348
  yield put(actions.requestAuthorize(true));
1343
1349
  payload === null || payload === void 0 ? void 0 : payload();
@@ -1346,8 +1352,7 @@ function* silentLogout({ payload }) {
1346
1352
  try {
1347
1353
  yield call(api.auth.logout);
1348
1354
  }
1349
- catch (_a) {
1350
- }
1355
+ catch (_a) { }
1351
1356
  setTimeout(() => payload === null || payload === void 0 ? void 0 : payload(), 500);
1352
1357
  }
1353
1358
  function* loginSagas() {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var auth_index = require('../index-825aae6c.js');
5
+ var auth_index = require('../index-60f5f9e5.js');
6
6
  var constants = require('../constants-52e37c08.js');
7
7
  var restApi = require('@frontegg/rest-api');
8
8
  require('@reduxjs/toolkit');
@@ -986,9 +986,16 @@ function* refreshToken() {
986
986
  else {
987
987
  yield effects.put(actions.setTenantsState({ tenants, loading: false }));
988
988
  yield effects.put(actions.setState({ user, isAuthenticated: true }));
989
- if ([routes.loginUrl, routes.socialLoginCallbackUrl, routes.signUpUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl]
990
- .some(url => url && window.location.pathname.endsWith(url))) {
991
- if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
989
+ if ([
990
+ routes.loginUrl,
991
+ routes.socialLoginCallbackUrl,
992
+ routes.signUpUrl,
993
+ routes.oidcRedirectUrl,
994
+ routes.samlCallbackUrl,
995
+ ].some((url) => url && window.location.pathname.endsWith(url))) {
996
+ if (loginState.isNewUser &&
997
+ routes.signUpSuccessUrl &&
998
+ routes.socialLoginCallbackUrl === window.location.pathname) {
992
999
  onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
993
1000
  }
994
1001
  else {
@@ -1183,14 +1190,14 @@ function* verifyInviteToken({ payload }) {
1183
1190
  yield effects.put(actions.setLoginState({ loading: false }));
1184
1191
  }
1185
1192
  }
1186
- function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback, }, }) {
1193
+ function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback }, }) {
1187
1194
  yield effects.put(actions.setLoginState({ loading: true }));
1188
1195
  try {
1189
1196
  const onRedirectTo = yield effects.select(({ auth: { onRedirectTo } }) => onRedirectTo);
1190
1197
  let { address, idpType } = yield effects.call(restApi.api.auth.preLoginV2, { email });
1191
1198
  if (address) {
1192
1199
  if (idpType === exports.SamlVendors.Oidc && !address.includes('redirect_uri')) {
1193
- const { routes: { oidcRedirectUrl } } = yield effects.select(({ auth: { routes } }) => ({ routes }));
1200
+ const { routes: { oidcRedirectUrl }, } = yield effects.select(({ auth: { routes } }) => ({ routes }));
1194
1201
  address += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
1195
1202
  }
1196
1203
  yield effects.put(actions.setLoginState({ step: exports.LoginStep.redirectToSSO, loading: false, ssoRedirectUrl: address }));
@@ -1208,7 +1215,7 @@ function* preLogin({ payload: { email, recaptchaToken, invitationToken, callback
1208
1215
  }
1209
1216
  function* ssoPreloginFailed(_a) {
1210
1217
  var { callback } = _a, body = tslib.__rest(_a, ["callback"]);
1211
- const publicPolicy = yield effects.select(({ auth: { securityPolicyState: { publicPolicy: { policy: publicPolicy } } } }) => publicPolicy);
1218
+ const publicPolicy = yield effects.select(({ auth: { securityPolicyState: { publicPolicy: { policy: publicPolicy }, }, }, }) => publicPolicy);
1212
1219
  if (!(publicPolicy === null || publicPolicy === void 0 ? void 0 : publicPolicy.authStrategy)) {
1213
1220
  yield effects.put(actions.setLoginState({ step: exports.LoginStep.loginWithPassword, loading: false }));
1214
1221
  callback === null || callback === void 0 ? void 0 : callback();
@@ -1246,7 +1253,7 @@ function* postLogin({ payload }) {
1246
1253
  yield effects.put(actions.setLoginState({ step: exports.LoginStep.loginWithSSOFailed, loading: false }));
1247
1254
  }
1248
1255
  }
1249
- function* login({ payload: { email, password, recaptchaToken, invitationToken, callback, }, }) {
1256
+ function* login({ payload: { email, password, recaptchaToken, invitationToken, callback }, }) {
1250
1257
  yield effects.put(actions.setLoginState({ loading: true }));
1251
1258
  try {
1252
1259
  const user = yield effects.call(restApi.api.auth.login, {
@@ -1345,8 +1352,7 @@ function* logout({ payload }) {
1345
1352
  try {
1346
1353
  yield effects.call(restApi.api.auth.logout);
1347
1354
  }
1348
- catch (_a) {
1349
- }
1355
+ catch (_a) { }
1350
1356
  yield effects.put(actions.resetState());
1351
1357
  yield effects.put(actions.requestAuthorize(true));
1352
1358
  payload === null || payload === void 0 ? void 0 : payload();
@@ -1355,8 +1361,7 @@ function* silentLogout({ payload }) {
1355
1361
  try {
1356
1362
  yield effects.call(restApi.api.auth.logout);
1357
1363
  }
1358
- catch (_a) {
1359
- }
1364
+ catch (_a) { }
1360
1365
  setTimeout(() => payload === null || payload === void 0 ? void 0 : payload(), 500);
1361
1366
  }
1362
1367
  function* loginSagas() {
package/node/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var auth_index = require('./index-825aae6c.js');
5
+ var auth_index = require('./index-60f5f9e5.js');
6
6
  var audits_index = require('./audits/index.js');
7
7
  var connectivity_index = require('./connectivity/index.js');
8
8
  var subscriptions_index = require('./subscriptions/index.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var auth_index = require('../index-825aae6c.js');
5
+ var auth_index = require('../index-60f5f9e5.js');
6
6
  var toolkit = require('@reduxjs/toolkit');
7
7
  var createSagaMiddleware = require('redux-saga');
8
8
  var effects = require('redux-saga/effects');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
3
  "libName": "FronteggReduxStore",
4
- "version": "5.50.0",
4
+ "version": "5.51.0",
5
5
  "author": "Frontegg LTD",
6
6
  "main": "./node/index.js",
7
7
  "module": "./index.js",