@frontegg/redux-store 6.6.1 → 6.7.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.
@@ -369,6 +369,24 @@ function* requestAuthorizeSSR({
369
369
  }));
370
370
  }
371
371
 
372
+ const getUri = urlStrategy => {
373
+ if (urlStrategy === 'path') {
374
+ var _window3;
375
+
376
+ return ((_window3 = window) != null ? _window3 : document).location.pathname;
377
+ } else {
378
+ var _window4;
379
+
380
+ let uri = (((_window4 = window) != null ? _window4 : document).location.hash || '#').substring(1);
381
+
382
+ if (uri.indexOf('?') !== -1) {
383
+ return uri.substring(0, uri.indexOf('?'));
384
+ } else {
385
+ return uri;
386
+ }
387
+ }
388
+ };
389
+
372
390
  function* requestHostedLoginAuthorize({
373
391
  payload: additionalParams
374
392
  }) {
@@ -382,6 +400,16 @@ function* requestHostedLoginAuthorize({
382
400
  onRedirectTo: state.auth.onRedirectTo,
383
401
  context: state.root.context,
384
402
  urlStrategy: state.root.urlStrategy
403
+ }));
404
+ const activeUri = getUri(urlStrategy);
405
+
406
+ if (activeUri === routes.hostedLoginRedirectUrl) {
407
+ console.debug('Calling loginWithRedirect while in hostedLoginCallback route');
408
+ return;
409
+ }
410
+
411
+ yield put(actions.setState({
412
+ isLoading: true
385
413
  })); // Generate the relevant params for the redirect
386
414
 
387
415
  const nonce = createRandomString();
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.6.1
1
+ /** @license Frontegg v6.7.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.
@@ -424,6 +424,24 @@ function* requestAuthorizeSSR({
424
424
  }));
425
425
  }
426
426
 
427
+ const getUri = urlStrategy => {
428
+ if (urlStrategy === 'path') {
429
+ var _window3;
430
+
431
+ return ((_window3 = window) != null ? _window3 : document).location.pathname;
432
+ } else {
433
+ var _window4;
434
+
435
+ let uri = (((_window4 = window) != null ? _window4 : document).location.hash || '#').substring(1);
436
+
437
+ if (uri.indexOf('?') !== -1) {
438
+ return uri.substring(0, uri.indexOf('?'));
439
+ } else {
440
+ return uri;
441
+ }
442
+ }
443
+ };
444
+
427
445
  function* requestHostedLoginAuthorize({
428
446
  payload: additionalParams
429
447
  }) {
@@ -437,6 +455,16 @@ function* requestHostedLoginAuthorize({
437
455
  onRedirectTo: state.auth.onRedirectTo,
438
456
  context: state.root.context,
439
457
  urlStrategy: state.root.urlStrategy
458
+ }));
459
+ const activeUri = getUri(urlStrategy);
460
+
461
+ if (activeUri === routes.hostedLoginRedirectUrl) {
462
+ console.debug('Calling loginWithRedirect while in hostedLoginCallback route');
463
+ return;
464
+ }
465
+
466
+ yield (0, _effects.put)(_reducer.actions.setState({
467
+ isLoading: true
440
468
  })); // Generate the relevant params for the redirect
441
469
 
442
470
  const nonce = (0, _helpers.createRandomString)();
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.6.1
1
+ /** @license Frontegg v6.7.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "6.6.1",
3
+ "version": "6.7.0",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",