@frontegg/redux-store 6.166.0 → 6.167.0-alpha.1
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/LoginState/saga.js +13 -2
- package/index.js +1 -1
- package/node/auth/LoginState/saga.js +13 -2
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/LoginState/saga.js
CHANGED
|
@@ -37,6 +37,7 @@ import { isEntitlementsDeeplyEqual } from '../Entitlements';
|
|
|
37
37
|
import { loadCustomLoginRoutes } from '../CustomLoginState/saga';
|
|
38
38
|
import { FronteggNativeModule } from '../../toolkit';
|
|
39
39
|
import { afterAuthenticationStateUpdate, shouldShowPromptPasskeys } from './saga.utils';
|
|
40
|
+
import { isSteppedUp } from '../StepUpState/utils';
|
|
40
41
|
import { afterAuthNavigation, loginWithMfa, preVerifyMFASMSForLogin, verifyMFASMSForLogin, preVerifyMFAWebAuthnForLogin, verifyMFAWebAuthnForLogin, preVerifyMFAEmailCodeForLogin, verifyMFAEmailCodeForLogin, afterStepUpAuthNavigation } from './sagas';
|
|
41
42
|
import { SHOULD_STEP_UP_KEY } from '../StepUpState/consts';
|
|
42
43
|
|
|
@@ -441,6 +442,9 @@ function* requestHostedLoginSilentAuthorize() {
|
|
|
441
442
|
function* refreshOrRequestHostedLoginAuthorize({
|
|
442
443
|
payload: additionalParams
|
|
443
444
|
}) {
|
|
445
|
+
var _localStorage;
|
|
446
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted - Remove it
|
|
447
|
+
(_localStorage = localStorage) == null ? void 0 : _localStorage.removeItem(SHOULD_STEP_UP_KEY);
|
|
444
448
|
const {
|
|
445
449
|
disableSilentRefresh
|
|
446
450
|
} = yield select(state => ({
|
|
@@ -467,7 +471,9 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
467
471
|
loginDirectAction
|
|
468
472
|
}
|
|
469
473
|
}) {
|
|
470
|
-
var _additionalParams;
|
|
474
|
+
var _localStorage2, _additionalParams;
|
|
475
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted - Remove it
|
|
476
|
+
(_localStorage2 = localStorage) == null ? void 0 : _localStorage2.removeItem(SHOULD_STEP_UP_KEY);
|
|
471
477
|
if (firstTime) {
|
|
472
478
|
const {
|
|
473
479
|
urlStrategy
|
|
@@ -620,9 +626,14 @@ function* handleHostedLoginCallback({
|
|
|
620
626
|
}));
|
|
621
627
|
console.error('Failed to exchangeOAuthTokens', e);
|
|
622
628
|
} finally {
|
|
629
|
+
const user = yield select(({
|
|
630
|
+
auth
|
|
631
|
+
}) => auth.user);
|
|
623
632
|
const isStepUpFlow = window.localStorage.getItem(SHOULD_STEP_UP_KEY);
|
|
624
633
|
window.localStorage.removeItem(SHOULD_STEP_UP_KEY);
|
|
625
|
-
|
|
634
|
+
|
|
635
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted. Ignore it.
|
|
636
|
+
if (isStepUpFlow && isSteppedUp(user)) {
|
|
626
637
|
yield afterStepUpAuthNavigation();
|
|
627
638
|
} else {
|
|
628
639
|
yield afterAuthNavigation();
|
package/index.js
CHANGED
|
@@ -47,6 +47,7 @@ var _Entitlements = require("../Entitlements");
|
|
|
47
47
|
var _saga4 = require("../CustomLoginState/saga");
|
|
48
48
|
var _toolkit = require("../../toolkit");
|
|
49
49
|
var _saga5 = require("./saga.utils");
|
|
50
|
+
var _utils4 = require("../StepUpState/utils");
|
|
50
51
|
var _sagas = require("./sagas");
|
|
51
52
|
var _consts2 = require("../StepUpState/consts");
|
|
52
53
|
var _afterAuthNavigation = require("./sagas/afterAuthNavigation.saga");
|
|
@@ -467,6 +468,9 @@ function* requestHostedLoginSilentAuthorize() {
|
|
|
467
468
|
function* refreshOrRequestHostedLoginAuthorize({
|
|
468
469
|
payload: additionalParams
|
|
469
470
|
}) {
|
|
471
|
+
var _localStorage;
|
|
472
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted - Remove it
|
|
473
|
+
(_localStorage = localStorage) == null ? void 0 : _localStorage.removeItem(_consts2.SHOULD_STEP_UP_KEY);
|
|
470
474
|
const {
|
|
471
475
|
disableSilentRefresh
|
|
472
476
|
} = yield (0, _effects.select)(state => ({
|
|
@@ -493,7 +497,9 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
493
497
|
loginDirectAction
|
|
494
498
|
}
|
|
495
499
|
}) {
|
|
496
|
-
var _additionalParams;
|
|
500
|
+
var _localStorage2, _additionalParams;
|
|
501
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted - Remove it
|
|
502
|
+
(_localStorage2 = localStorage) == null ? void 0 : _localStorage2.removeItem(_consts2.SHOULD_STEP_UP_KEY);
|
|
497
503
|
if (firstTime) {
|
|
498
504
|
const {
|
|
499
505
|
urlStrategy
|
|
@@ -646,9 +652,14 @@ function* handleHostedLoginCallback({
|
|
|
646
652
|
}));
|
|
647
653
|
console.error('Failed to exchangeOAuthTokens', e);
|
|
648
654
|
} finally {
|
|
655
|
+
const user = yield (0, _effects.select)(({
|
|
656
|
+
auth
|
|
657
|
+
}) => auth.user);
|
|
649
658
|
const isStepUpFlow = window.localStorage.getItem(_consts2.SHOULD_STEP_UP_KEY);
|
|
650
659
|
window.localStorage.removeItem(_consts2.SHOULD_STEP_UP_KEY);
|
|
651
|
-
|
|
660
|
+
|
|
661
|
+
// when the user pause the step up flow we may still have the key in the local storage in hosted. Ignore it.
|
|
662
|
+
if (isStepUpFlow && (0, _utils4.isSteppedUp)(user)) {
|
|
652
663
|
yield (0, _sagas.afterStepUpAuthNavigation)();
|
|
653
664
|
} else {
|
|
654
665
|
yield (0, _sagas.afterAuthNavigation)();
|
package/node/index.js
CHANGED