@frontegg/redux-store 7.41.0 → 7.42.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/LoginState/actions/index.d.ts +1 -1
- package/auth/LoginState/actions/mfaRequiredState.actions.d.ts +1 -1
- package/auth/LoginState/actions/mfaRequiredState.actions.js +3 -3
- package/auth/SignUpState/actions.js +1 -1
- package/index.js +1 -1
- package/mocks/auth-mocks/loginActions.mocks.d.ts +1 -1
- package/node/auth/LoginState/actions/mfaRequiredState.actions.js +3 -3
- package/node/auth/SignUpState/actions.js +1 -1
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
18
18
|
verifyMFAEmailCodeForLogin: (payload: WithCallback<import("@frontegg/rest-api").IVerifyMFAEmailCode>) => Promise<void>;
|
|
19
19
|
mfaWithAuthenticator: ({ callback, ...loginWithMfaPayload }: WithCallback<import("@frontegg/rest-api").ILoginWithMfa>, setLoadingAction: import("../interfaces").SetLoadingAction, isStepUp: boolean) => Promise<void>;
|
|
20
20
|
loginWithMfa: (payload: WithCallback<import("@frontegg/rest-api").ILoginWithMfa>) => Promise<void>;
|
|
21
|
-
getMfaRequiredState: (user: import("../../interfaces").User | any, retryConfig?: import("../../../interfaces").RetryConfig, shouldContinueWhenFailing?: boolean) => Promise<Partial<AuthState> & {
|
|
21
|
+
getMfaRequiredState: (user: import("../../interfaces").User | any, retryConfig?: import("../../../interfaces").RetryConfig, shouldContinueWhenFailing?: boolean, emailFromSignup?: string) => Promise<Partial<AuthState> & {
|
|
22
22
|
mfaState: Partial<MFAState>;
|
|
23
23
|
loginState: Partial<LoginState>;
|
|
24
24
|
}>;
|
|
@@ -3,7 +3,7 @@ import { MFAState } from '../../MfaState/interfaces';
|
|
|
3
3
|
import { AuthState, User } from '../../interfaces';
|
|
4
4
|
import { FronteggState, RestApi, RetryConfig, SharedActions } from '../../../interfaces';
|
|
5
5
|
declare const _default: (store: FronteggState, api: RestApi, _sharedActions: SharedActions) => {
|
|
6
|
-
getMfaRequiredState: (user: User | any, retryConfig?: RetryConfig, shouldContinueWhenFailing?: boolean) => Promise<Partial<AuthState> & {
|
|
6
|
+
getMfaRequiredState: (user: User | any, retryConfig?: RetryConfig, shouldContinueWhenFailing?: boolean, emailFromSignup?: string) => Promise<Partial<AuthState> & {
|
|
7
7
|
mfaState: Partial<MFAState>;
|
|
8
8
|
loginState: Partial<LoginState>;
|
|
9
9
|
}>;
|
|
@@ -4,8 +4,8 @@ import { LoginStep, LoginFlow } from '../interfaces';
|
|
|
4
4
|
import { MFAStep } from '../../MfaState/interfaces';
|
|
5
5
|
import { retryIfNeeded } from '../../../helpers';
|
|
6
6
|
export default ((store, api, _sharedActions) => {
|
|
7
|
-
const getMfaRequiredState = async (user, retryConfig, shouldContinueWhenFailing = false) => {
|
|
8
|
-
var _user$mfaDevices, _user$mfaDevices$emai;
|
|
7
|
+
const getMfaRequiredState = async (user, retryConfig, shouldContinueWhenFailing = false, emailFromSignup) => {
|
|
8
|
+
var _user$mfaDevices, _user$mfaDevices$emai, _user$userEmail;
|
|
9
9
|
let step = LoginStep.loginWithTwoFactor;
|
|
10
10
|
const mfaState = {
|
|
11
11
|
step: MFAStep.verify,
|
|
@@ -61,7 +61,7 @@ export default ((store, api, _sharedActions) => {
|
|
|
61
61
|
error: undefined,
|
|
62
62
|
step,
|
|
63
63
|
tenantsLoading: true,
|
|
64
|
-
email: user.userEmail,
|
|
64
|
+
email: (_user$userEmail = user.userEmail) != null ? _user$userEmail : emailFromSignup,
|
|
65
65
|
tenants: [],
|
|
66
66
|
allowRememberMfaDevice: isAllowedToRemember,
|
|
67
67
|
mfaDeviceExpiration,
|
|
@@ -77,7 +77,7 @@ export default ((store, api, sharedActions) => {
|
|
|
77
77
|
reportGTMEvent(GTMEventAction.SIGNUP_COMPLETED, signUpCompletePayload);
|
|
78
78
|
}
|
|
79
79
|
if (!shouldActivate && user && isMfaRequired(user, store.root.appName)) {
|
|
80
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user, DEFAULT_RETRY_CONFIG, true);
|
|
80
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, DEFAULT_RETRY_CONFIG, true, payload.email);
|
|
81
81
|
actions.setAuthState(mfaRequiredState);
|
|
82
82
|
onRedirectTo(routes.loginUrl);
|
|
83
83
|
} else {
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ declare const _default: (store: FronteggState, api: RestApi, sharedActions: Shar
|
|
|
14
14
|
verifyMFAEmailCodeForLogin: (payload: WithCallback<import("dist/@frontegg/rest-api").IVerifyMFAEmailCode>) => Promise<void>;
|
|
15
15
|
mfaWithAuthenticator: ({ callback, ...loginWithMfaPayload }: WithCallback<import("dist/@frontegg/rest-api").ILoginWithMfa>, setLoadingAction: import("../..").SetLoadingAction, isStepUp: boolean) => Promise<void>;
|
|
16
16
|
loginWithMfa: (payload: WithCallback<import("dist/@frontegg/rest-api").ILoginWithMfa>) => Promise<void>;
|
|
17
|
-
getMfaRequiredState: (user: import("../..").User | any, retryConfig?: import("../../interfaces").RetryConfig, shouldContinueWhenFailing?: boolean) => Promise<Partial<import("../..").AuthState> & {
|
|
17
|
+
getMfaRequiredState: (user: import("../..").User | any, retryConfig?: import("../../interfaces").RetryConfig, shouldContinueWhenFailing?: boolean, emailFromSignup?: string) => Promise<Partial<import("../..").AuthState> & {
|
|
18
18
|
mfaState: Partial<import("../..").MFAState>;
|
|
19
19
|
loginState: Partial<import("../..").LoginState>;
|
|
20
20
|
}>;
|
|
@@ -11,8 +11,8 @@ var _interfaces = require("../interfaces");
|
|
|
11
11
|
var _interfaces2 = require("../../MfaState/interfaces");
|
|
12
12
|
var _helpers2 = require("../../../helpers");
|
|
13
13
|
var _default = (store, api, _sharedActions) => {
|
|
14
|
-
const getMfaRequiredState = async (user, retryConfig, shouldContinueWhenFailing = false) => {
|
|
15
|
-
var _user$mfaDevices, _user$mfaDevices$emai;
|
|
14
|
+
const getMfaRequiredState = async (user, retryConfig, shouldContinueWhenFailing = false, emailFromSignup) => {
|
|
15
|
+
var _user$mfaDevices, _user$mfaDevices$emai, _user$userEmail;
|
|
16
16
|
let step = _interfaces.LoginStep.loginWithTwoFactor;
|
|
17
17
|
const mfaState = {
|
|
18
18
|
step: _interfaces2.MFAStep.verify,
|
|
@@ -68,7 +68,7 @@ var _default = (store, api, _sharedActions) => {
|
|
|
68
68
|
error: undefined,
|
|
69
69
|
step,
|
|
70
70
|
tenantsLoading: true,
|
|
71
|
-
email: user.userEmail,
|
|
71
|
+
email: (_user$userEmail = user.userEmail) != null ? _user$userEmail : emailFromSignup,
|
|
72
72
|
tenants: [],
|
|
73
73
|
allowRememberMfaDevice: isAllowedToRemember,
|
|
74
74
|
mfaDeviceExpiration,
|
|
@@ -84,7 +84,7 @@ var _default = (store, api, sharedActions) => {
|
|
|
84
84
|
(0, _gtm.reportGTMEvent)(_gtm.GTMEventAction.SIGNUP_COMPLETED, signUpCompletePayload);
|
|
85
85
|
}
|
|
86
86
|
if (!shouldActivate && user && (0, _helpers2.isMfaRequired)(user, store.root.appName)) {
|
|
87
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user, _constants.DEFAULT_RETRY_CONFIG, true);
|
|
87
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, _constants.DEFAULT_RETRY_CONFIG, true, payload.email);
|
|
88
88
|
actions.setAuthState(mfaRequiredState);
|
|
89
89
|
onRedirectTo(routes.loginUrl);
|
|
90
90
|
} else {
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.42.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.
|
|
10
|
+
"@frontegg/rest-api": "7.42.0",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|