@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
const _excluded = ["callback", "events"],
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
_excluded2 = ["callback"],
|
|
4
|
+
_excluded3 = ["callback"];
|
|
5
5
|
import { call, delay, put, select, takeLeading } from 'redux-saga/effects';
|
|
6
6
|
import { api, ContextHolder } from '@frontegg/rest-api';
|
|
7
7
|
import { actions } from '../reducer';
|
|
@@ -9,7 +9,6 @@ import { afterAuthNavigation, getMfaRequiredState, isMfaRequired } from '../Logi
|
|
|
9
9
|
import { UserVeirifedOriginTypes } from '../interfaces';
|
|
10
10
|
import { ActivateAccountStep } from './interfaces';
|
|
11
11
|
import { TeamStateKeys } from '../TeamState/interfaces';
|
|
12
|
-
|
|
13
12
|
function* preActivateAccount({
|
|
14
13
|
payload: {
|
|
15
14
|
userId,
|
|
@@ -20,16 +19,13 @@ function* preActivateAccount({
|
|
|
20
19
|
loading: true,
|
|
21
20
|
step: ActivateAccountStep.activating
|
|
22
21
|
}));
|
|
23
|
-
|
|
24
22
|
try {
|
|
25
23
|
const {
|
|
26
24
|
isAuthenticated
|
|
27
25
|
} = yield select(state => state.auth);
|
|
28
|
-
|
|
29
26
|
if (isAuthenticated) {
|
|
30
27
|
yield put(actions.silentLogout());
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
const strategy = yield call(api.auth.getActivateAccountStrategy, {
|
|
34
30
|
userId,
|
|
35
31
|
token
|
|
@@ -39,7 +35,6 @@ function* preActivateAccount({
|
|
|
39
35
|
loading: false,
|
|
40
36
|
error: undefined
|
|
41
37
|
}));
|
|
42
|
-
|
|
43
38
|
if (strategy.shouldSetPassword) {
|
|
44
39
|
yield put(actions.setActivateState({
|
|
45
40
|
loading: false,
|
|
@@ -53,32 +48,27 @@ function* preActivateAccount({
|
|
|
53
48
|
}));
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
|
-
|
|
57
51
|
function* activateAccount(_ref) {
|
|
58
52
|
let {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
payload: {
|
|
54
|
+
callback,
|
|
55
|
+
events
|
|
56
|
+
}
|
|
57
|
+
} = _ref,
|
|
58
|
+
payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
66
59
|
yield put(actions.setActivateState({
|
|
67
60
|
loading: true
|
|
68
61
|
}));
|
|
69
|
-
|
|
70
62
|
try {
|
|
71
63
|
const onRedirectTo = ContextHolder.onRedirectTo;
|
|
72
64
|
const {
|
|
73
65
|
routes
|
|
74
66
|
} = yield select(state => state.auth);
|
|
75
67
|
const data = yield call(api.auth.activateAccount, payload);
|
|
76
|
-
|
|
77
68
|
if (data.redirectLocation) {
|
|
78
69
|
window.location.href = data.redirectLocation;
|
|
79
70
|
return;
|
|
80
71
|
}
|
|
81
|
-
|
|
82
72
|
if (isMfaRequired(data)) {
|
|
83
73
|
yield put(actions.setActivateState({
|
|
84
74
|
step: ActivateAccountStep.success
|
|
@@ -91,7 +81,6 @@ function* activateAccount(_ref) {
|
|
|
91
81
|
});
|
|
92
82
|
} else {
|
|
93
83
|
var _events$userVerified;
|
|
94
|
-
|
|
95
84
|
yield put(actions.setActivateState({
|
|
96
85
|
step: ActivateAccountStep.success
|
|
97
86
|
}));
|
|
@@ -119,7 +108,6 @@ function* activateAccount(_ref) {
|
|
|
119
108
|
yield afterAuthNavigation();
|
|
120
109
|
yield put(actions.resetActivateState());
|
|
121
110
|
}
|
|
122
|
-
|
|
123
111
|
callback == null ? void 0 : callback(true);
|
|
124
112
|
} catch (e) {
|
|
125
113
|
yield put(actions.setActivateState({
|
|
@@ -128,19 +116,16 @@ function* activateAccount(_ref) {
|
|
|
128
116
|
}));
|
|
129
117
|
}
|
|
130
118
|
}
|
|
131
|
-
|
|
132
119
|
function* getActivateAccountStrategy({
|
|
133
120
|
payload
|
|
134
121
|
}) {
|
|
135
122
|
const {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
123
|
+
callback
|
|
124
|
+
} = payload,
|
|
125
|
+
params = _objectWithoutPropertiesLoose(payload, _excluded2);
|
|
140
126
|
yield put(actions.setActivateStrategyState({
|
|
141
127
|
loading: true
|
|
142
128
|
}));
|
|
143
|
-
|
|
144
129
|
try {
|
|
145
130
|
const strategy = yield call(api.auth.getActivateAccountStrategy, params);
|
|
146
131
|
yield put(actions.setActivateStrategyState({
|
|
@@ -156,15 +141,13 @@ function* getActivateAccountStrategy({
|
|
|
156
141
|
}));
|
|
157
142
|
}
|
|
158
143
|
}
|
|
159
|
-
|
|
160
144
|
function* resendActivationEmailFunction({
|
|
161
145
|
payload
|
|
162
146
|
}) {
|
|
163
147
|
const {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
148
|
+
callback
|
|
149
|
+
} = payload,
|
|
150
|
+
body = _objectWithoutPropertiesLoose(payload, _excluded3);
|
|
168
151
|
yield put(actions.setTeamLoader({
|
|
169
152
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
170
153
|
value: body.email
|
|
@@ -172,7 +155,6 @@ function* resendActivationEmailFunction({
|
|
|
172
155
|
yield put(actions.setActivateState({
|
|
173
156
|
loading: true
|
|
174
157
|
}));
|
|
175
|
-
|
|
176
158
|
try {
|
|
177
159
|
yield call(api.auth.resendActivationEmail, body);
|
|
178
160
|
yield put(actions.setActivateState({
|
|
@@ -192,13 +174,11 @@ function* resendActivationEmailFunction({
|
|
|
192
174
|
}));
|
|
193
175
|
callback == null ? void 0 : callback(null, e.message);
|
|
194
176
|
}
|
|
195
|
-
|
|
196
177
|
yield put(actions.setTeamLoader({
|
|
197
178
|
key: TeamStateKeys.RESEND_ACTIVATE_LINK,
|
|
198
179
|
value: false
|
|
199
180
|
}));
|
|
200
181
|
}
|
|
201
|
-
|
|
202
182
|
export function* activateSagas() {
|
|
203
183
|
yield takeLeading(actions.activateAccount, activateAccount);
|
|
204
184
|
yield takeLeading(actions.preActivateAccount, preActivateAccount);
|
|
@@ -37,6 +37,7 @@ declare const reducers: {
|
|
|
37
37
|
user?: import("..").User | null | undefined;
|
|
38
38
|
isSSOAuth: boolean;
|
|
39
39
|
ssoACS?: string | undefined;
|
|
40
|
+
includeQueryParam?: boolean | undefined;
|
|
40
41
|
loginState: import("..").LoginState;
|
|
41
42
|
activateState: import("..").ActivateAccountState;
|
|
42
43
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -75,6 +76,7 @@ declare const reducers: {
|
|
|
75
76
|
user?: import("..").User | null | undefined;
|
|
76
77
|
isSSOAuth: boolean;
|
|
77
78
|
ssoACS?: string | undefined;
|
|
79
|
+
includeQueryParam?: boolean | undefined;
|
|
78
80
|
loginState: import("..").LoginState;
|
|
79
81
|
activateState: import("..").ActivateAccountState;
|
|
80
82
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -56,13 +56,13 @@ const actions = {
|
|
|
56
56
|
payload
|
|
57
57
|
}))
|
|
58
58
|
};
|
|
59
|
+
|
|
59
60
|
/**
|
|
60
61
|
* To be used for actions types after dispatch, and should contains
|
|
61
62
|
* the reducers and actions as standalone function
|
|
62
63
|
*/
|
|
63
64
|
|
|
64
65
|
// noinspection JSUnusedLocalSymbols
|
|
65
|
-
|
|
66
66
|
/**
|
|
67
67
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
68
68
|
* contains the same functions in reducers and actions
|
|
@@ -5,7 +5,6 @@ import { actions } from '../reducer';
|
|
|
5
5
|
import { ApiStateKeys } from './interfaces';
|
|
6
6
|
import { apiTokensDataDemo, apiTokensDataTenantDemo } from '../dummy';
|
|
7
7
|
import { v4 as uuidv4 } from 'uuid';
|
|
8
|
-
|
|
9
8
|
function* addUserApiToken({
|
|
10
9
|
payload
|
|
11
10
|
}) {
|
|
@@ -17,7 +16,6 @@ function* addUserApiToken({
|
|
|
17
16
|
const {
|
|
18
17
|
apiTokensDataUser
|
|
19
18
|
} = yield select(state => state.auth.apiTokensState);
|
|
20
|
-
|
|
21
19
|
try {
|
|
22
20
|
yield put(actions.setApiTokensLoader({
|
|
23
21
|
key: ApiStateKeys.ADD_API_TOKEN,
|
|
@@ -25,14 +23,12 @@ function* addUserApiToken({
|
|
|
25
23
|
}));
|
|
26
24
|
let data;
|
|
27
25
|
let expiresInMinutes;
|
|
28
|
-
|
|
29
26
|
if (expires !== undefined) {
|
|
30
27
|
if (expires === null) {
|
|
31
28
|
expiresInMinutes = null;
|
|
32
29
|
} else {
|
|
33
30
|
expiresInMinutes = expires * 1440;
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
data = yield call(api.auth.createUserAccessToken, {
|
|
37
33
|
description,
|
|
38
34
|
expiresInMinutes
|
|
@@ -42,7 +38,6 @@ function* addUserApiToken({
|
|
|
42
38
|
description
|
|
43
39
|
});
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
yield put(actions.setApiTokensState({
|
|
47
42
|
showAddTokenDialog: false
|
|
48
43
|
}));
|
|
@@ -72,7 +67,6 @@ function* addUserApiToken({
|
|
|
72
67
|
callback == null ? void 0 : callback(null, e.message);
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
|
-
|
|
76
70
|
function* addTenantApiToken({
|
|
77
71
|
payload
|
|
78
72
|
}) {
|
|
@@ -85,7 +79,6 @@ function* addTenantApiToken({
|
|
|
85
79
|
const {
|
|
86
80
|
apiTokensDataTenant
|
|
87
81
|
} = yield select(state => state.auth.apiTokensState);
|
|
88
|
-
|
|
89
82
|
try {
|
|
90
83
|
yield put(actions.setApiTokensLoader({
|
|
91
84
|
key: ApiStateKeys.ADD_API_TOKEN,
|
|
@@ -93,14 +86,12 @@ function* addTenantApiToken({
|
|
|
93
86
|
}));
|
|
94
87
|
let data;
|
|
95
88
|
let expiresInMinutes;
|
|
96
|
-
|
|
97
89
|
if (expires !== undefined) {
|
|
98
90
|
if (expires === null) {
|
|
99
91
|
expiresInMinutes = null;
|
|
100
92
|
} else {
|
|
101
93
|
expiresInMinutes = expires * 1440;
|
|
102
94
|
}
|
|
103
|
-
|
|
104
95
|
data = yield call(api.auth.createTenantAccessToken, {
|
|
105
96
|
description,
|
|
106
97
|
expiresInMinutes,
|
|
@@ -112,7 +103,6 @@ function* addTenantApiToken({
|
|
|
112
103
|
roleIds
|
|
113
104
|
});
|
|
114
105
|
}
|
|
115
|
-
|
|
116
106
|
yield put(actions.setApiTokensState({
|
|
117
107
|
showAddTokenDialog: false
|
|
118
108
|
}));
|
|
@@ -142,7 +132,6 @@ function* addTenantApiToken({
|
|
|
142
132
|
callback == null ? void 0 : callback(null, e.message);
|
|
143
133
|
}
|
|
144
134
|
}
|
|
145
|
-
|
|
146
135
|
function* deleteUserApiToken({
|
|
147
136
|
payload
|
|
148
137
|
}) {
|
|
@@ -150,13 +139,11 @@ function* deleteUserApiToken({
|
|
|
150
139
|
apiTokensDataUser
|
|
151
140
|
} = yield select(state => state.auth.apiTokensState);
|
|
152
141
|
const isAccessToken = apiTokensDataUser.some(token => token.id === payload);
|
|
153
|
-
|
|
154
142
|
try {
|
|
155
143
|
yield put(actions.setApiTokensLoader({
|
|
156
144
|
key: ApiStateKeys.DELETE_API_TOKEN,
|
|
157
145
|
value: true
|
|
158
146
|
}));
|
|
159
|
-
|
|
160
147
|
if (isAccessToken) {
|
|
161
148
|
yield call(api.auth.deleteUserAccessToken, {
|
|
162
149
|
id: payload
|
|
@@ -180,7 +167,6 @@ function* deleteUserApiToken({
|
|
|
180
167
|
}
|
|
181
168
|
}));
|
|
182
169
|
}
|
|
183
|
-
|
|
184
170
|
yield put(actions.setApiTokensLoader({
|
|
185
171
|
key: ApiStateKeys.DELETE_API_TOKEN,
|
|
186
172
|
value: false
|
|
@@ -196,7 +182,6 @@ function* deleteUserApiToken({
|
|
|
196
182
|
}));
|
|
197
183
|
}
|
|
198
184
|
}
|
|
199
|
-
|
|
200
185
|
function* deleteTenantApiToken({
|
|
201
186
|
payload
|
|
202
187
|
}) {
|
|
@@ -205,13 +190,11 @@ function* deleteTenantApiToken({
|
|
|
205
190
|
} = yield select(state => state.auth.apiTokensState);
|
|
206
191
|
const isAccessToken = apiTokensDataTenant.some(token => token.id === payload);
|
|
207
192
|
let filteredApiTokensDataTenant = apiTokensDataTenant;
|
|
208
|
-
|
|
209
193
|
try {
|
|
210
194
|
yield put(actions.setApiTokensLoader({
|
|
211
195
|
key: ApiStateKeys.DELETE_API_TOKEN,
|
|
212
196
|
value: true
|
|
213
197
|
}));
|
|
214
|
-
|
|
215
198
|
if (isAccessToken) {
|
|
216
199
|
yield call(api.auth.deleteTenantAccessToken, {
|
|
217
200
|
id: payload
|
|
@@ -223,7 +206,6 @@ function* deleteTenantApiToken({
|
|
|
223
206
|
});
|
|
224
207
|
filteredApiTokensDataTenant = apiTokensDataTenant.filter(token => token.clientId !== payload);
|
|
225
208
|
}
|
|
226
|
-
|
|
227
209
|
yield put(actions.setApiTokensState({
|
|
228
210
|
apiTokensDataTenant: filteredApiTokensDataTenant,
|
|
229
211
|
deleteTokenDialog: {
|
|
@@ -246,7 +228,6 @@ function* deleteTenantApiToken({
|
|
|
246
228
|
}));
|
|
247
229
|
}
|
|
248
230
|
}
|
|
249
|
-
|
|
250
231
|
function* loadApiTokens({
|
|
251
232
|
payload
|
|
252
233
|
}) {
|
|
@@ -256,10 +237,8 @@ function* loadApiTokens({
|
|
|
256
237
|
value: true
|
|
257
238
|
}));
|
|
258
239
|
}
|
|
259
|
-
|
|
260
240
|
try {
|
|
261
241
|
var _payload$callback;
|
|
262
|
-
|
|
263
242
|
const [apiTokensDataUser = [], apiTokensDataTenant = []] = yield all([call(api.auth.getUserApiTokensData), call(api.auth.getTenantApiTokensData)]);
|
|
264
243
|
yield put(actions.setApiTokensState({
|
|
265
244
|
apiTokensDataUser,
|
|
@@ -272,7 +251,6 @@ function* loadApiTokens({
|
|
|
272
251
|
payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
273
252
|
} catch (e) {
|
|
274
253
|
var _payload$callback2;
|
|
275
|
-
|
|
276
254
|
yield put(actions.setApiTokensError({
|
|
277
255
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
278
256
|
value: e.message
|
|
@@ -284,7 +262,6 @@ function* loadApiTokens({
|
|
|
284
262
|
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
285
263
|
}
|
|
286
264
|
}
|
|
287
|
-
|
|
288
265
|
function* loadUserApiTokens({
|
|
289
266
|
payload
|
|
290
267
|
}) {
|
|
@@ -294,10 +271,8 @@ function* loadUserApiTokens({
|
|
|
294
271
|
value: true
|
|
295
272
|
}));
|
|
296
273
|
}
|
|
297
|
-
|
|
298
274
|
try {
|
|
299
275
|
var _call, _call2, _accessTokensData$acc, _payload$callback3;
|
|
300
|
-
|
|
301
276
|
const apiTokensData = yield (_call = call(api.auth.getUserApiTokensData)) != null ? _call : [];
|
|
302
277
|
const accessTokensData = yield (_call2 = call(api.auth.getUserAccessTokensData)) != null ? _call2 : [];
|
|
303
278
|
const accessTokens = (_accessTokensData$acc = accessTokensData.accessTokens) != null ? _accessTokensData$acc : [];
|
|
@@ -313,7 +288,6 @@ function* loadUserApiTokens({
|
|
|
313
288
|
payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
314
289
|
} catch (e) {
|
|
315
290
|
var _payload$callback4;
|
|
316
|
-
|
|
317
291
|
yield put(actions.setApiTokensError({
|
|
318
292
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
319
293
|
value: e.message
|
|
@@ -325,7 +299,6 @@ function* loadUserApiTokens({
|
|
|
325
299
|
payload == null ? void 0 : (_payload$callback4 = payload.callback) == null ? void 0 : _payload$callback4.call(payload, null, e);
|
|
326
300
|
}
|
|
327
301
|
}
|
|
328
|
-
|
|
329
302
|
function* loadTenantApiTokens({
|
|
330
303
|
payload
|
|
331
304
|
}) {
|
|
@@ -335,10 +308,8 @@ function* loadTenantApiTokens({
|
|
|
335
308
|
value: true
|
|
336
309
|
}));
|
|
337
310
|
}
|
|
338
|
-
|
|
339
311
|
try {
|
|
340
312
|
var _call3, _call4, _accessTokensData$acc2, _payload$callback5;
|
|
341
|
-
|
|
342
313
|
const apiTokensData = yield (_call3 = call(api.auth.getTenantApiTokensData)) != null ? _call3 : [];
|
|
343
314
|
const accessTokensData = yield (_call4 = call(api.auth.getTenantAccessTokensData)) != null ? _call4 : [];
|
|
344
315
|
const accessTokens = (_accessTokensData$acc2 = accessTokensData == null ? void 0 : accessTokensData.accessTokens) != null ? _accessTokensData$acc2 : [];
|
|
@@ -354,7 +325,6 @@ function* loadTenantApiTokens({
|
|
|
354
325
|
payload == null ? void 0 : (_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, true);
|
|
355
326
|
} catch (e) {
|
|
356
327
|
var _payload$callback6;
|
|
357
|
-
|
|
358
328
|
yield put(actions.setApiTokensError({
|
|
359
329
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
360
330
|
value: e.message
|
|
@@ -366,7 +336,6 @@ function* loadTenantApiTokens({
|
|
|
366
336
|
payload == null ? void 0 : (_payload$callback6 = payload.callback) == null ? void 0 : _payload$callback6.call(payload, null, e);
|
|
367
337
|
}
|
|
368
338
|
}
|
|
369
|
-
|
|
370
339
|
export function* apiTokensSaga() {
|
|
371
340
|
yield takeLeading(actions.loadApiTokens, loadApiTokens);
|
|
372
341
|
yield takeLeading(actions.loadUserApiTokens, loadUserApiTokens);
|
|
@@ -376,6 +345,7 @@ export function* apiTokensSaga() {
|
|
|
376
345
|
yield takeLatest(actions.deleteTenantApiToken, deleteTenantApiToken);
|
|
377
346
|
yield takeLatest(actions.deleteUserApiToken, deleteUserApiToken);
|
|
378
347
|
}
|
|
348
|
+
|
|
379
349
|
/*********************************
|
|
380
350
|
* Preview Sagas
|
|
381
351
|
*********************************/
|
|
@@ -395,13 +365,11 @@ function* addTenantApiTokenMock({
|
|
|
395
365
|
const {
|
|
396
366
|
apiTokensDataTenant
|
|
397
367
|
} = yield select(state => state.auth.apiTokensState);
|
|
398
|
-
|
|
399
368
|
const newToken = _extends({}, apiTokensDataTenantDemo, {
|
|
400
369
|
description,
|
|
401
370
|
roleIds,
|
|
402
371
|
clientId: `CLIENT_ID_${uuidv4()}`
|
|
403
372
|
});
|
|
404
|
-
|
|
405
373
|
yield put(actions.setApiTokensState({
|
|
406
374
|
showAddTokenDialog: false
|
|
407
375
|
}));
|
|
@@ -421,7 +389,6 @@ function* addTenantApiTokenMock({
|
|
|
421
389
|
}));
|
|
422
390
|
callback == null ? void 0 : callback(null);
|
|
423
391
|
}
|
|
424
|
-
|
|
425
392
|
function* deleteTenantApiTokenMock({
|
|
426
393
|
payload
|
|
427
394
|
}) {
|
|
@@ -443,19 +410,16 @@ function* deleteTenantApiTokenMock({
|
|
|
443
410
|
value: false
|
|
444
411
|
}));
|
|
445
412
|
}
|
|
446
|
-
|
|
447
413
|
function* loadApiTokensMock({
|
|
448
414
|
payload
|
|
449
415
|
}) {
|
|
450
416
|
var _payload$callback7;
|
|
451
|
-
|
|
452
417
|
if (!(payload != null && payload.silentLoading)) {
|
|
453
418
|
yield put(actions.setApiTokensLoader({
|
|
454
419
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
455
420
|
value: true
|
|
456
421
|
}));
|
|
457
422
|
}
|
|
458
|
-
|
|
459
423
|
const apiTokensDataUser = [apiTokensDataDemo];
|
|
460
424
|
const apiTokensDataTenant = [apiTokensDataTenantDemo];
|
|
461
425
|
yield put(actions.setApiTokensState({
|
|
@@ -469,19 +433,16 @@ function* loadApiTokensMock({
|
|
|
469
433
|
}));
|
|
470
434
|
payload == null ? void 0 : (_payload$callback7 = payload.callback) == null ? void 0 : _payload$callback7.call(payload, true);
|
|
471
435
|
}
|
|
472
|
-
|
|
473
436
|
function* loadUserApiTokensMock({
|
|
474
437
|
payload
|
|
475
438
|
}) {
|
|
476
439
|
var _payload$callback8;
|
|
477
|
-
|
|
478
440
|
if (!(payload != null && payload.silentLoading)) {
|
|
479
441
|
yield put(actions.setApiTokensLoader({
|
|
480
442
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
481
443
|
value: true
|
|
482
444
|
}));
|
|
483
445
|
}
|
|
484
|
-
|
|
485
446
|
const apiTokensDataUser = [apiTokensDataDemo];
|
|
486
447
|
yield put(actions.setApiTokensState({
|
|
487
448
|
apiTokensDataUser
|
|
@@ -493,19 +454,16 @@ function* loadUserApiTokensMock({
|
|
|
493
454
|
}));
|
|
494
455
|
payload == null ? void 0 : (_payload$callback8 = payload.callback) == null ? void 0 : _payload$callback8.call(payload, true);
|
|
495
456
|
}
|
|
496
|
-
|
|
497
457
|
function* loadTenantApiTokensMock({
|
|
498
458
|
payload
|
|
499
459
|
}) {
|
|
500
460
|
var _payload$callback9;
|
|
501
|
-
|
|
502
461
|
if (!(payload != null && payload.silentLoading)) {
|
|
503
462
|
yield put(actions.setApiTokensLoader({
|
|
504
463
|
key: ApiStateKeys.LOAD_API_TOKENS,
|
|
505
464
|
value: true
|
|
506
465
|
}));
|
|
507
466
|
}
|
|
508
|
-
|
|
509
467
|
const apiTokensDataTenant = [apiTokensDataTenantDemo];
|
|
510
468
|
yield put(actions.setApiTokensState({
|
|
511
469
|
apiTokensDataTenant
|
|
@@ -517,7 +475,6 @@ function* loadTenantApiTokensMock({
|
|
|
517
475
|
}));
|
|
518
476
|
payload == null ? void 0 : (_payload$callback9 = payload.callback) == null ? void 0 : _payload$callback9.call(payload, true);
|
|
519
477
|
}
|
|
520
|
-
|
|
521
478
|
export function* apiTokensSagaMock() {
|
|
522
479
|
yield takeLeading(actions.loadApiTokens, loadApiTokensMock);
|
|
523
480
|
yield takeLeading(actions.loadUserApiTokens, loadUserApiTokensMock);
|
|
@@ -20,6 +20,7 @@ declare const reducers: {
|
|
|
20
20
|
user?: import("..").User | null | undefined;
|
|
21
21
|
isSSOAuth: boolean;
|
|
22
22
|
ssoACS?: string | undefined;
|
|
23
|
+
includeQueryParam?: boolean | undefined;
|
|
23
24
|
loginState: import("..").LoginState;
|
|
24
25
|
activateState: import("..").ActivateAccountState;
|
|
25
26
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -58,6 +59,7 @@ declare const reducers: {
|
|
|
58
59
|
user?: import("..").User | null | undefined;
|
|
59
60
|
isSSOAuth: boolean;
|
|
60
61
|
ssoACS?: string | undefined;
|
|
62
|
+
includeQueryParam?: boolean | undefined;
|
|
61
63
|
loginState: import("..").LoginState;
|
|
62
64
|
activateState: import("..").ActivateAccountState;
|
|
63
65
|
acceptInvitationState: import("..").AcceptInvitationState;
|
|
@@ -25,13 +25,13 @@ const actions = {
|
|
|
25
25
|
payload
|
|
26
26
|
}))
|
|
27
27
|
};
|
|
28
|
+
|
|
28
29
|
/**
|
|
29
30
|
* To be used for actions types after dispatch, and should contains
|
|
30
31
|
* the reducers and actions as standalone function
|
|
31
32
|
*/
|
|
32
33
|
|
|
33
34
|
// noinspection JSUnusedLocalSymbols
|
|
34
|
-
|
|
35
35
|
/**
|
|
36
36
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
37
37
|
* contains the same functions in reducers and actions
|
|
@@ -4,14 +4,12 @@ import { call, put, takeLeading } from 'redux-saga/effects';
|
|
|
4
4
|
import { api } from '@frontegg/rest-api';
|
|
5
5
|
import { actions } from '../reducer';
|
|
6
6
|
import { ForgotPasswordStep } from './interfaces';
|
|
7
|
-
|
|
8
7
|
function* forgotPassword({
|
|
9
8
|
payload
|
|
10
9
|
}) {
|
|
11
10
|
yield put(actions.setForgotPasswordState({
|
|
12
11
|
loading: true
|
|
13
12
|
}));
|
|
14
|
-
|
|
15
13
|
try {
|
|
16
14
|
yield call(api.auth.forgotPassword, payload);
|
|
17
15
|
yield put(actions.setForgotPasswordState({
|
|
@@ -26,19 +24,16 @@ function* forgotPassword({
|
|
|
26
24
|
}));
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
|
|
30
27
|
function* resetPassword(_ref) {
|
|
31
28
|
let {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
payload: {
|
|
30
|
+
callback
|
|
31
|
+
}
|
|
32
|
+
} = _ref,
|
|
33
|
+
body = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
38
34
|
yield put(actions.setForgotPasswordState({
|
|
39
35
|
loading: true
|
|
40
36
|
}));
|
|
41
|
-
|
|
42
37
|
try {
|
|
43
38
|
yield call(api.auth.resetPassword, body);
|
|
44
39
|
yield put(actions.setForgotPasswordState({
|
|
@@ -55,14 +50,12 @@ function* resetPassword(_ref) {
|
|
|
55
50
|
callback == null ? void 0 : callback(false);
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
|
-
|
|
59
53
|
export function* loadPasswordConfig({
|
|
60
54
|
payload
|
|
61
55
|
}) {
|
|
62
56
|
yield put(actions.setForgotPasswordState({
|
|
63
57
|
loading: true
|
|
64
58
|
}));
|
|
65
|
-
|
|
66
59
|
try {
|
|
67
60
|
const passwordConfig = yield call(api.auth.loadPasswordConfig, payload);
|
|
68
61
|
yield put(actions.setForgotPasswordState({
|
|
@@ -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;
|
|
@@ -17,13 +17,13 @@ const actions = {
|
|
|
17
17
|
payload
|
|
18
18
|
}))
|
|
19
19
|
};
|
|
20
|
+
|
|
20
21
|
/**
|
|
21
22
|
* To be used for actions types after dispatch, and should contains
|
|
22
23
|
* the reducers and actions as standalone function
|
|
23
24
|
*/
|
|
24
25
|
|
|
25
26
|
// noinspection JSUnusedLocalSymbols
|
|
26
|
-
|
|
27
27
|
/**
|
|
28
28
|
* if you see error in matcher that's mean the DispatchAction does not
|
|
29
29
|
* contains the same functions in reducers and actions
|
|
@@ -4,19 +4,16 @@ import { api } from '@frontegg/rest-api';
|
|
|
4
4
|
import { call, put, takeLeading } from 'redux-saga/effects';
|
|
5
5
|
import { actions } from '../reducer';
|
|
6
6
|
import { ImpersonateStep } from './interfaces';
|
|
7
|
-
|
|
8
7
|
function* impersonate(_ref) {
|
|
9
8
|
let {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
payload: {
|
|
10
|
+
callback
|
|
11
|
+
}
|
|
12
|
+
} = _ref,
|
|
13
|
+
payload = _objectWithoutPropertiesLoose(_ref.payload, _excluded);
|
|
16
14
|
yield put(actions.setImpersonateState({
|
|
17
15
|
loading: true
|
|
18
16
|
}));
|
|
19
|
-
|
|
20
17
|
try {
|
|
21
18
|
const data = yield call(api.impersonate.impersonate, payload);
|
|
22
19
|
yield put(actions.setImpersonateState({
|
|
@@ -31,7 +28,6 @@ function* impersonate(_ref) {
|
|
|
31
28
|
}));
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
export function* impersonateSagas() {
|
|
36
32
|
yield takeLeading(actions.impersonate, impersonate);
|
|
37
33
|
}
|