@frontegg/redux-store 6.69.0 → 6.70.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/audits/AuditLogsState/index.js +1 -1
- package/audits/AuditLogsState/saga.js +1 -18
- package/audits/AuditsMetadataState/index.js +1 -1
- package/audits/AuditsMetadataState/saga.js +1 -5
- package/audits/backward-compatibility/saga.js +0 -18
- package/audits/dummy.js +0 -16
- package/audits/index.js +4 -2
- package/audits/reducer.js +0 -2
- package/auth/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AcceptInvitationState/index.js +1 -1
- package/auth/AcceptInvitationState/interfaces.js +0 -1
- package/auth/AcceptInvitationState/saga.js +0 -3
- package/auth/AccountSettingsState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.js +1 -1
- package/auth/AccountSettingsState/interfaces.d.ts +2 -0
- package/auth/AccountSettingsState/saga.js +1 -11
- package/auth/ActivateState/index.d.ts +3 -0
- package/auth/ActivateState/index.js +1 -1
- package/auth/ActivateState/interfaces.js +0 -1
- package/auth/ActivateState/saga.js +14 -34
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ApiTokensState/index.js +1 -1
- package/auth/ApiTokensState/interfaces.d.ts +1 -0
- package/auth/ApiTokensState/interfaces.js +0 -1
- package/auth/ApiTokensState/saga.js +1 -44
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.js +1 -1
- package/auth/ForgotPasswordState/interfaces.js +0 -1
- package/auth/ForgotPasswordState/saga.js +5 -12
- package/auth/ImpersonationState/index.d.ts +2 -0
- package/auth/ImpersonationState/index.js +1 -1
- package/auth/ImpersonationState/interfaces.js +0 -1
- package/auth/ImpersonationState/saga.js +5 -9
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/LoginState/index.js +1 -1
- package/auth/LoginState/interfaces.js +0 -6
- package/auth/LoginState/saga.d.ts +2 -38
- package/auth/LoginState/saga.js +132 -292
- package/auth/MfaState/index.d.ts +4 -2
- package/auth/MfaState/index.js +1 -1
- package/auth/MfaState/interfaces.d.ts +2 -2
- package/auth/MfaState/interfaces.js +0 -1
- package/auth/MfaState/saga.js +64 -143
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/ProfileState/index.js +1 -1
- package/auth/ProfileState/saga.js +22 -50
- package/auth/Provisioning/index.d.ts +2 -0
- package/auth/Provisioning/index.js +1 -1
- package/auth/Provisioning/saga.js +11 -23
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/ResetPhoneNumberState/index.js +1 -1
- package/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/auth/ResetPhoneNumberState/saga.js +17 -26
- package/auth/RestrictionsState/index.d.ts +3 -0
- package/auth/RestrictionsState/index.js +1 -1
- package/auth/RestrictionsState/saga.js +52 -105
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/RolesState/index.js +1 -1
- package/auth/RolesState/saga.js +30 -51
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SSOState/index.js +1 -1
- package/auth/SSOState/interfaces.js +0 -3
- package/auth/SSOState/saga.js +10 -58
- package/auth/SSOState/saga.v2.js +13 -49
- package/auth/SecurityPolicyState/index.d.ts +13 -0
- package/auth/SecurityPolicyState/index.js +1 -1
- package/auth/SecurityPolicyState/saga.js +36 -90
- package/auth/SessionsPolicyState/index.d.ts +2 -0
- package/auth/SessionsPolicyState/index.js +1 -1
- package/auth/SessionsPolicyState/saga.js +7 -19
- package/auth/SessionsState/index.d.ts +2 -0
- package/auth/SessionsState/index.js +1 -1
- package/auth/SessionsState/saga.js +1 -15
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SignUp/index.js +1 -1
- package/auth/SignUp/interfaces.js +0 -1
- package/auth/SignUp/saga.js +6 -15
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/SocialLogins/index.js +1 -1
- package/auth/SocialLogins/saga.js +10 -20
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TeamState/index.js +1 -1
- package/auth/TeamState/interfaces.js +0 -1
- package/auth/TeamState/saga.js +85 -205
- package/auth/TenantsState/index.d.ts +2 -0
- package/auth/TenantsState/index.js +1 -1
- package/auth/TenantsState/saga.js +1 -17
- package/auth/index.d.ts +2 -2
- package/auth/index.js +4 -3
- package/auth/interfaces.d.ts +2 -1
- package/auth/interfaces.js +0 -6
- package/auth/reducer.d.ts +2 -2
- package/auth/reducer.js +0 -2
- package/auth/saga.js +2 -1
- package/auth/utils.d.ts +4 -0
- package/auth/utils.js +7 -21
- package/connectivity/ConnectivityState/index.d.ts +9 -0
- package/connectivity/ConnectivityState/index.js +1 -1
- package/connectivity/consts.js +0 -5
- package/connectivity/index.js +4 -2
- package/connectivity/interfaces.d.ts +1 -0
- package/connectivity/reducer.js +0 -2
- package/connectivity/saga.js +48 -85
- package/helpers.js +4 -7
- package/index.js +1 -1
- package/node/audits/AuditLogsState/index.js +1 -8
- package/node/audits/AuditLogsState/saga.js +1 -26
- package/node/audits/AuditsMetadataState/index.js +1 -8
- package/node/audits/AuditsMetadataState/saga.js +1 -10
- package/node/audits/backward-compatibility/index.js +0 -8
- package/node/audits/backward-compatibility/reducer.js +0 -5
- package/node/audits/backward-compatibility/saga.js +0 -23
- package/node/audits/dummy.js +0 -19
- package/node/audits/index.js +0 -14
- package/node/audits/initialState.js +0 -3
- package/node/audits/reducer.js +0 -8
- package/node/audits/saga.js +0 -5
- package/node/audits/utils.js +0 -4
- package/node/auth/AcceptInvitationState/index.js +1 -7
- package/node/auth/AcceptInvitationState/interfaces.js +0 -1
- package/node/auth/AcceptInvitationState/saga.js +0 -7
- package/node/auth/AccountSettingsState/index.js +1 -6
- package/node/auth/AccountSettingsState/saga.js +1 -16
- package/node/auth/ActivateState/index.js +1 -7
- package/node/auth/ActivateState/interfaces.js +0 -1
- package/node/auth/ActivateState/saga.js +14 -41
- package/node/auth/ApiTokensState/index.js +1 -6
- package/node/auth/ApiTokensState/interfaces.js +0 -1
- package/node/auth/ApiTokensState/saga.js +1 -51
- package/node/auth/ForgotPasswordState/index.js +1 -7
- package/node/auth/ForgotPasswordState/interfaces.js +0 -1
- package/node/auth/ForgotPasswordState/saga.js +5 -19
- package/node/auth/ImpersonationState/index.js +1 -7
- package/node/auth/ImpersonationState/interfaces.js +0 -1
- package/node/auth/ImpersonationState/saga.js +5 -15
- package/node/auth/LoginState/index.js +1 -7
- package/node/auth/LoginState/interfaces.js +0 -7
- package/node/auth/LoginState/saga.js +132 -322
- package/node/auth/MfaState/index.js +1 -7
- package/node/auth/MfaState/interfaces.js +0 -1
- package/node/auth/MfaState/saga.js +64 -137
- package/node/auth/ProfileState/index.js +1 -6
- package/node/auth/ProfileState/saga.js +22 -58
- package/node/auth/Provisioning/index.js +1 -6
- package/node/auth/Provisioning/saga.js +11 -28
- package/node/auth/ResetPhoneNumberState/index.js +1 -7
- package/node/auth/ResetPhoneNumberState/interfaces.js +0 -1
- package/node/auth/ResetPhoneNumberState/saga.js +17 -32
- package/node/auth/RestrictionsState/index.js +1 -7
- package/node/auth/RestrictionsState/saga.js +52 -109
- package/node/auth/RolesState/index.js +1 -6
- package/node/auth/RolesState/saga.js +30 -54
- package/node/auth/SSOState/index.js +1 -6
- package/node/auth/SSOState/interfaces.js +0 -3
- package/node/auth/SSOState/saga.js +10 -63
- package/node/auth/SSOState/saga.v2.js +13 -53
- package/node/auth/SecurityPolicyState/index.js +1 -6
- package/node/auth/SecurityPolicyState/saga.js +36 -89
- package/node/auth/SessionsPolicyState/index.js +1 -6
- package/node/auth/SessionsPolicyState/saga.js +7 -24
- package/node/auth/SessionsState/index.js +1 -6
- package/node/auth/SessionsState/saga.js +1 -22
- package/node/auth/SignUp/index.js +1 -7
- package/node/auth/SignUp/interfaces.js +0 -1
- package/node/auth/SignUp/saga.js +6 -30
- package/node/auth/SocialLogins/index.js +1 -6
- package/node/auth/SocialLogins/saga.js +10 -33
- package/node/auth/TeamState/index.js +1 -6
- package/node/auth/TeamState/interfaces.js +0 -1
- package/node/auth/TeamState/saga.js +86 -190
- package/node/auth/TenantsState/index.js +1 -6
- package/node/auth/TenantsState/saga.js +1 -24
- package/node/auth/dummy.js +0 -5
- package/node/auth/index.js +0 -90
- package/node/auth/initialState.js +0 -23
- package/node/auth/interfaces.js +0 -6
- package/node/auth/reducer.js +0 -28
- package/node/auth/saga.js +2 -26
- package/node/auth/utils.js +7 -42
- package/node/connectivity/ConnectivityState/index.js +1 -7
- package/node/connectivity/consts.js +1 -7
- package/node/connectivity/index.js +0 -5
- package/node/connectivity/reducer.js +0 -6
- package/node/connectivity/saga.js +47 -91
- package/node/helpers.js +2 -14
- package/node/index.js +1 -17
- package/node/subscriptions/Billing/Information/index.js +0 -7
- package/node/subscriptions/Billing/Information/saga.js +1 -25
- package/node/subscriptions/Billing/Invoices/index.js +0 -6
- package/node/subscriptions/Billing/Invoices/saga.js +1 -13
- package/node/subscriptions/Billing/PaymentMethod/index.js +2 -8
- package/node/subscriptions/Billing/PaymentMethod/interfaces.js +0 -1
- package/node/subscriptions/Billing/PaymentMethod/saga.js +1 -17
- package/node/subscriptions/Billing/Subscription/index.js +0 -6
- package/node/subscriptions/Billing/Subscription/saga.js +3 -23
- package/node/subscriptions/Billing/index.js +0 -6
- package/node/subscriptions/Billing/interfaces.js +0 -8
- package/node/subscriptions/Billing/saga.js +0 -7
- package/node/subscriptions/Checkout/index.js +0 -6
- package/node/subscriptions/Checkout/saga.js +2 -22
- package/node/subscriptions/Config/index.js +0 -6
- package/node/subscriptions/Config/saga.js +1 -12
- package/node/subscriptions/Plans/index.js +0 -6
- package/node/subscriptions/Plans/saga.js +1 -13
- package/node/subscriptions/Stripe/index.js +0 -6
- package/node/subscriptions/Stripe/saga.js +0 -8
- package/node/subscriptions/VendorPublicConfig/index.js +0 -6
- package/node/subscriptions/VendorPublicConfig/saga.js +1 -9
- package/node/subscriptions/dummy.js +2 -4
- package/node/subscriptions/general.interfaces.js +0 -5
- package/node/subscriptions/index.js +0 -5
- package/node/subscriptions/interfaces.js +0 -14
- package/node/subscriptions/mapper.js +0 -11
- package/node/subscriptions/reducer.js +0 -9
- package/node/subscriptions/saga.js +0 -9
- package/node/subscriptions/utils.js +0 -6
- package/node/toolkit/index.js +0 -31
- package/node/toolkit/redux-saga.js +0 -3
- package/node/toolkit/redux.js +0 -1
- package/node/vendor/VendorState/index.js +1 -7
- package/node/vendor/index.js +0 -5
- package/node/vendor/reducer.js +0 -6
- package/node/vendor/saga.js +1 -9
- package/package.json +1 -1
- package/subscriptions/Billing/Information/index.js +0 -4
- package/subscriptions/Billing/Information/saga.js +1 -12
- package/subscriptions/Billing/Invoices/index.js +0 -4
- package/subscriptions/Billing/Invoices/saga.js +1 -5
- package/subscriptions/Billing/PaymentMethod/index.js +2 -6
- package/subscriptions/Billing/PaymentMethod/interfaces.js +1 -1
- package/subscriptions/Billing/PaymentMethod/saga.js +1 -9
- package/subscriptions/Billing/Subscription/index.js +0 -4
- package/subscriptions/Billing/Subscription/saga.js +3 -17
- package/subscriptions/Billing/interfaces.js +1 -0
- package/subscriptions/Checkout/index.js +0 -4
- package/subscriptions/Checkout/saga.js +2 -12
- package/subscriptions/Config/index.js +0 -4
- package/subscriptions/Config/saga.js +1 -7
- package/subscriptions/Plans/index.js +0 -2
- package/subscriptions/Plans/saga.js +1 -6
- package/subscriptions/Stripe/index.js +0 -4
- package/subscriptions/Stripe/saga.js +0 -4
- package/subscriptions/VendorPublicConfig/index.js +0 -2
- package/subscriptions/VendorPublicConfig/saga.js +1 -4
- package/subscriptions/dummy.js +3 -2
- package/subscriptions/general.interfaces.js +0 -5
- package/subscriptions/index.js +3 -1
- package/subscriptions/mapper.js +0 -5
- package/toolkit/index.d.ts +1 -1
- package/toolkit/index.js +0 -9
- package/vendor/VendorState/index.js +1 -0
- package/vendor/index.js +4 -2
- package/vendor/reducer.js +0 -2
- package/vendor/saga.js +1 -2
|
@@ -2,13 +2,11 @@ import { takeLatest, put, call, select, takeEvery } from 'redux-saga/effects';
|
|
|
2
2
|
import { api } from '@frontegg/rest-api';
|
|
3
3
|
import { actions } from '../reducer';
|
|
4
4
|
import { sessionsMock } from '../dummy';
|
|
5
|
-
|
|
6
5
|
function* loadCurrentUserSessions() {
|
|
7
6
|
yield put(actions.setSessionsState({
|
|
8
7
|
loading: true,
|
|
9
8
|
error: null
|
|
10
9
|
}));
|
|
11
|
-
|
|
12
10
|
try {
|
|
13
11
|
const sessions = yield call(api.auth.getCurrentUserSessions);
|
|
14
12
|
yield put(actions.setSessionsState({
|
|
@@ -22,13 +20,11 @@ function* loadCurrentUserSessions() {
|
|
|
22
20
|
}));
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
|
|
26
23
|
function* loadCurrentUserSession() {
|
|
27
24
|
yield put(actions.setSessionsState({
|
|
28
25
|
loading: true,
|
|
29
26
|
error: null
|
|
30
27
|
}));
|
|
31
|
-
|
|
32
28
|
try {
|
|
33
29
|
const session = yield call(api.auth.getCurrentUserSession);
|
|
34
30
|
yield put(actions.setSessionsState({
|
|
@@ -42,7 +38,6 @@ function* loadCurrentUserSession() {
|
|
|
42
38
|
}));
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
function* deleteUserSession({
|
|
47
42
|
payload: {
|
|
48
43
|
id
|
|
@@ -52,7 +47,6 @@ function* deleteUserSession({
|
|
|
52
47
|
loading: true,
|
|
53
48
|
error: null
|
|
54
49
|
}));
|
|
55
|
-
|
|
56
50
|
try {
|
|
57
51
|
yield call(api.auth.deleteSessionForUser, id);
|
|
58
52
|
yield put(actions.loadUserSessions());
|
|
@@ -63,7 +57,6 @@ function* deleteUserSession({
|
|
|
63
57
|
}));
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
|
-
|
|
67
60
|
function* revokeUserSessions({
|
|
68
61
|
payload: {
|
|
69
62
|
callback,
|
|
@@ -74,7 +67,6 @@ function* revokeUserSessions({
|
|
|
74
67
|
loading: true,
|
|
75
68
|
error: null
|
|
76
69
|
}));
|
|
77
|
-
|
|
78
70
|
try {
|
|
79
71
|
yield call(api.auth.revokeSessionsForUser, userId);
|
|
80
72
|
callback == null ? void 0 : callback(true);
|
|
@@ -86,13 +78,11 @@ function* revokeUserSessions({
|
|
|
86
78
|
callback == null ? void 0 : callback(false);
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
|
-
|
|
90
81
|
function* deleteAllUserSessions() {
|
|
91
82
|
yield put(actions.setSessionsState({
|
|
92
83
|
loading: true,
|
|
93
84
|
error: null
|
|
94
85
|
}));
|
|
95
|
-
|
|
96
86
|
try {
|
|
97
87
|
yield call(api.auth.deleteAllSessionsForUser);
|
|
98
88
|
yield put(actions.loadUserSessions());
|
|
@@ -103,7 +93,6 @@ function* deleteAllUserSessions() {
|
|
|
103
93
|
}));
|
|
104
94
|
}
|
|
105
95
|
}
|
|
106
|
-
|
|
107
96
|
export function* sessionsSaga() {
|
|
108
97
|
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessions);
|
|
109
98
|
yield takeLatest(actions.deleteUserSession, deleteUserSession);
|
|
@@ -111,6 +100,7 @@ export function* sessionsSaga() {
|
|
|
111
100
|
yield takeLatest(actions.loadCurrentUserSession, loadCurrentUserSession);
|
|
112
101
|
yield takeEvery(actions.revokeUserSessions, revokeUserSessions);
|
|
113
102
|
}
|
|
103
|
+
|
|
114
104
|
/*********************************
|
|
115
105
|
* Preview Sagas
|
|
116
106
|
*********************************/
|
|
@@ -125,7 +115,6 @@ function* loadCurrentUserSessionsMock() {
|
|
|
125
115
|
loading: false
|
|
126
116
|
}));
|
|
127
117
|
}
|
|
128
|
-
|
|
129
118
|
function* deleteUserSessionMock({
|
|
130
119
|
payload: {
|
|
131
120
|
id
|
|
@@ -137,7 +126,6 @@ function* deleteUserSessionMock({
|
|
|
137
126
|
}));
|
|
138
127
|
const currentSessions = yield select(state => {
|
|
139
128
|
var _state$auth$sessionsS;
|
|
140
|
-
|
|
141
129
|
return (_state$auth$sessionsS = state.auth.sessionsState.sessions) != null ? _state$auth$sessionsS : [];
|
|
142
130
|
});
|
|
143
131
|
const newSessions = currentSessions.filter(s => s.id !== id);
|
|
@@ -146,7 +134,6 @@ function* deleteUserSessionMock({
|
|
|
146
134
|
loading: false
|
|
147
135
|
}));
|
|
148
136
|
}
|
|
149
|
-
|
|
150
137
|
function* deleteAllUserSessionsMock() {
|
|
151
138
|
yield put(actions.setSessionsState({
|
|
152
139
|
loading: true,
|
|
@@ -158,7 +145,6 @@ function* deleteAllUserSessionsMock() {
|
|
|
158
145
|
loading: false
|
|
159
146
|
}));
|
|
160
147
|
}
|
|
161
|
-
|
|
162
148
|
export function* sessionsSagaMock() {
|
|
163
149
|
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessionsMock);
|
|
164
150
|
yield takeLatest(actions.deleteUserSession, deleteUserSessionMock);
|
package/auth/SignUp/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare const reducers: {
|
|
|
18
18
|
user?: import("..").User | null | undefined;
|
|
19
19
|
isSSOAuth: boolean;
|
|
20
20
|
ssoACS?: string | undefined;
|
|
21
|
+
includeQueryParam?: boolean | undefined;
|
|
21
22
|
loginState: import("..").LoginState;
|
|
22
23
|
activateState: import("..").ActivateAccountState;
|
|
23
24
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -56,6 +57,7 @@ declare const reducers: {
|
|
|
56
57
|
user?: import("..").User | null | undefined;
|
|
57
58
|
isSSOAuth: boolean;
|
|
58
59
|
ssoACS?: string | undefined;
|
|
60
|
+
includeQueryParam?: boolean | undefined;
|
|
59
61
|
loginState: import("..").LoginState;
|
|
60
62
|
activateState: import("..").ActivateAccountState;
|
|
61
63
|
acceptInvitationState: import("..").AcceptInvitationState;
|
package/auth/SignUp/index.js
CHANGED
|
@@ -21,13 +21,13 @@ const actions = {
|
|
|
21
21
|
})),
|
|
22
22
|
resetSignUpStateSoft: createAction(`${authStoreName}/resetSignUpStateSoft`)
|
|
23
23
|
};
|
|
24
|
+
|
|
24
25
|
/**
|
|
25
26
|
* To be used for actions types after dispatch, and should contains
|
|
26
27
|
* the reducers and actions as standalone function
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
30
|
// noinspection JSUnusedLocalSymbols
|
|
30
|
-
|
|
31
31
|
/**
|
|
32
32
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
33
33
|
* contains the same functions in reducers and actions
|
package/auth/SignUp/saga.js
CHANGED
|
@@ -10,7 +10,6 @@ export function* loadAllowSignUps() {
|
|
|
10
10
|
yield put(actions.setSignUpState({
|
|
11
11
|
loading: true
|
|
12
12
|
}));
|
|
13
|
-
|
|
14
13
|
try {
|
|
15
14
|
const policy = yield call(api.auth.getVendorConfig);
|
|
16
15
|
const {
|
|
@@ -37,17 +36,15 @@ export function* loadAllowSignUps() {
|
|
|
37
36
|
}
|
|
38
37
|
export function* signUpUser(_ref) {
|
|
39
38
|
let {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
payload: {
|
|
40
|
+
events,
|
|
41
|
+
url
|
|
42
|
+
}
|
|
43
|
+
} = _ref,
|
|
44
|
+
payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
47
45
|
yield put(actions.setSignUpState({
|
|
48
46
|
loading: true
|
|
49
47
|
}));
|
|
50
|
-
|
|
51
48
|
try {
|
|
52
49
|
const {
|
|
53
50
|
routes,
|
|
@@ -59,10 +56,8 @@ export function* signUpUser(_ref) {
|
|
|
59
56
|
tenantId,
|
|
60
57
|
userId
|
|
61
58
|
} = yield call(api.auth.signUpUser, payload);
|
|
62
|
-
|
|
63
59
|
if (!payload.invitationToken) {
|
|
64
60
|
var _events$signUpComplet;
|
|
65
|
-
|
|
66
61
|
const {
|
|
67
62
|
email,
|
|
68
63
|
name,
|
|
@@ -79,10 +74,8 @@ export function* signUpUser(_ref) {
|
|
|
79
74
|
createdAt: new Date()
|
|
80
75
|
});
|
|
81
76
|
}
|
|
82
|
-
|
|
83
77
|
ContextHolder.setAccessToken(user == null ? void 0 : user.accessToken);
|
|
84
78
|
ContextHolder.setUser(user);
|
|
85
|
-
|
|
86
79
|
if (!shouldActivate && user && isMfaRequired(user)) {
|
|
87
80
|
const mfaRequiredState = yield getMfaRequiredState(user);
|
|
88
81
|
yield put(actions.setState(mfaRequiredState));
|
|
@@ -97,7 +90,6 @@ export function* signUpUser(_ref) {
|
|
|
97
90
|
user,
|
|
98
91
|
isAuthenticated: !!(user != null && user.accessToken)
|
|
99
92
|
}));
|
|
100
|
-
|
|
101
93
|
if (!shouldActivate) {
|
|
102
94
|
yield put(actions.loadTenants());
|
|
103
95
|
}
|
|
@@ -110,7 +102,6 @@ export function* signUpUser(_ref) {
|
|
|
110
102
|
error: e.message
|
|
111
103
|
}));
|
|
112
104
|
}
|
|
113
|
-
|
|
114
105
|
yield put(actions.setSignUpState({
|
|
115
106
|
loading: false
|
|
116
107
|
}));
|
|
@@ -19,6 +19,7 @@ declare const reducers: {
|
|
|
19
19
|
user?: import("..").User | null | undefined;
|
|
20
20
|
isSSOAuth: boolean;
|
|
21
21
|
ssoACS?: string | undefined;
|
|
22
|
+
includeQueryParam?: boolean | undefined;
|
|
22
23
|
loginState: import("..").LoginState;
|
|
23
24
|
activateState: import("..").ActivateAccountState;
|
|
24
25
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -57,6 +58,7 @@ declare const reducers: {
|
|
|
57
58
|
user?: import("..").User | null | undefined;
|
|
58
59
|
isSSOAuth: boolean;
|
|
59
60
|
ssoACS?: string | undefined;
|
|
61
|
+
includeQueryParam?: boolean | undefined;
|
|
60
62
|
loginState: import("..").LoginState;
|
|
61
63
|
activateState: import("..").ActivateAccountState;
|
|
62
64
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -22,13 +22,13 @@ const actions = {
|
|
|
22
22
|
payload
|
|
23
23
|
}))
|
|
24
24
|
};
|
|
25
|
+
|
|
25
26
|
/**
|
|
26
27
|
* To be used for actions types after dispatch, and should contains
|
|
27
28
|
* the reducers and actions as standalone function
|
|
28
29
|
*/
|
|
29
30
|
|
|
30
31
|
// noinspection JSUnusedLocalSymbols
|
|
31
|
-
|
|
32
32
|
/**
|
|
33
33
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
34
34
|
* contains the same functions in reducers and actions
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["authorizationUrl"],
|
|
4
|
-
|
|
4
|
+
_excluded2 = ["events", "url"];
|
|
5
5
|
import { api, fetch } from '@frontegg/rest-api';
|
|
6
6
|
import { call, put, select, takeLatest, takeLeading } from 'redux-saga/effects';
|
|
7
7
|
import { refreshToken } from '../LoginState/saga';
|
|
@@ -36,10 +36,9 @@ export function* loadSocialLoginsConfigurationsV2() {
|
|
|
36
36
|
const socialLoginsConfigV2 = yield call(api.auth.getSocialLoginProvidersV2);
|
|
37
37
|
const socialLoginsConfigWithFullUrl = socialLoginsConfigV2.map(_ref => {
|
|
38
38
|
let {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
authorizationUrl
|
|
40
|
+
} = _ref,
|
|
41
|
+
config = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
42
|
const baseUrl = fetch.getBaseUrl(context, authorizationUrl != null ? authorizationUrl : '');
|
|
44
43
|
return _extends({}, config, {
|
|
45
44
|
authorizationUrl: authorizationUrl ? `${baseUrl}${authorizationUrl}` : null
|
|
@@ -58,16 +57,14 @@ export function* loadSocialLoginsConfigurationsV2() {
|
|
|
58
57
|
}));
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
|
-
|
|
62
60
|
function* loginViaSocialLogin(_ref2) {
|
|
63
61
|
let {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
payload: {
|
|
63
|
+
events,
|
|
64
|
+
url
|
|
65
|
+
}
|
|
66
|
+
} = _ref2,
|
|
67
|
+
payload = _objectWithoutPropertiesLoose(_ref2.payload, _excluded2);
|
|
71
68
|
try {
|
|
72
69
|
yield put(actions.setSocialLoginsState({
|
|
73
70
|
loading: true
|
|
@@ -79,10 +76,8 @@ function* loginViaSocialLogin(_ref2) {
|
|
|
79
76
|
tenantId,
|
|
80
77
|
name
|
|
81
78
|
} = yield call(api.auth.loginViaSocialLogin, payload);
|
|
82
|
-
|
|
83
79
|
if (isNewUser) {
|
|
84
80
|
var _events$signUpComplet, _events$userVerified;
|
|
85
|
-
|
|
86
81
|
events == null ? void 0 : (_events$signUpComplet = events.signUpComplete) == null ? void 0 : _events$signUpComplet.call(events, {
|
|
87
82
|
email,
|
|
88
83
|
url,
|
|
@@ -102,11 +97,9 @@ function* loginViaSocialLogin(_ref2) {
|
|
|
102
97
|
name
|
|
103
98
|
});
|
|
104
99
|
}
|
|
105
|
-
|
|
106
100
|
if (userId) {
|
|
107
101
|
localStorage.setItem('userId', userId);
|
|
108
102
|
}
|
|
109
|
-
|
|
110
103
|
yield put(actions.setLoginState({
|
|
111
104
|
email,
|
|
112
105
|
isNewUser
|
|
@@ -118,7 +111,6 @@ function* loginViaSocialLogin(_ref2) {
|
|
|
118
111
|
}));
|
|
119
112
|
} catch (e) {
|
|
120
113
|
var _e$message;
|
|
121
|
-
|
|
122
114
|
yield put(actions.setSocialLoginsState({
|
|
123
115
|
loading: false,
|
|
124
116
|
error: (_e$message = e.message) != null ? _e$message : 'Failed to authenticate',
|
|
@@ -126,7 +118,6 @@ function* loginViaSocialLogin(_ref2) {
|
|
|
126
118
|
}));
|
|
127
119
|
}
|
|
128
120
|
}
|
|
129
|
-
|
|
130
121
|
function* setSocialLoginError({
|
|
131
122
|
payload
|
|
132
123
|
}) {
|
|
@@ -136,7 +127,6 @@ function* setSocialLoginError({
|
|
|
136
127
|
firstLoad: false
|
|
137
128
|
}));
|
|
138
129
|
}
|
|
139
|
-
|
|
140
130
|
export function* socialLoginsSaga() {
|
|
141
131
|
yield takeLeading(actions.loadSocialLoginsConfiguration, loadSocialLoginsConfigurations);
|
|
142
132
|
yield takeLeading(actions.loadSocialLoginsConfigurationV2, loadSocialLoginsConfigurationsV2);
|
|
@@ -38,6 +38,7 @@ declare const reducers: {
|
|
|
38
38
|
user?: import("..").User | null | undefined;
|
|
39
39
|
isSSOAuth: boolean;
|
|
40
40
|
ssoACS?: string | undefined;
|
|
41
|
+
includeQueryParam?: boolean | undefined;
|
|
41
42
|
loginState: import("..").LoginState;
|
|
42
43
|
activateState: import("..").ActivateAccountState;
|
|
43
44
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -76,6 +77,7 @@ declare const reducers: {
|
|
|
76
77
|
user?: import("..").User | null | undefined;
|
|
77
78
|
isSSOAuth: boolean;
|
|
78
79
|
ssoACS?: string | undefined;
|
|
80
|
+
includeQueryParam?: boolean | undefined;
|
|
79
81
|
loginState: import("..").LoginState;
|
|
80
82
|
activateState: import("..").ActivateAccountState;
|
|
81
83
|
acceptInvitationState: import("..").AcceptInvitationState;
|
package/auth/TeamState/index.js
CHANGED
|
@@ -116,13 +116,13 @@ const actions = {
|
|
|
116
116
|
payload
|
|
117
117
|
}))
|
|
118
118
|
};
|
|
119
|
+
|
|
119
120
|
/**
|
|
120
121
|
* To be used for actions types after dispatch, and should contains
|
|
121
122
|
* the reducers and actions as standalone function
|
|
122
123
|
*/
|
|
123
124
|
|
|
124
125
|
// noinspection JSUnusedLocalSymbols
|
|
125
|
-
|
|
126
126
|
/**
|
|
127
127
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
128
128
|
* contains the same functions in reducers and actions
|