@frontegg/redux-store 5.64.4 → 5.66.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/AcceptInvitationState/index.d.ts +2 -0
- package/auth/AccountSettingsState/index.d.ts +2 -0
- package/auth/ActivateState/index.d.ts +3 -0
- package/auth/ApiTokensState/index.d.ts +2 -0
- package/auth/ForgotPasswordState/index.d.ts +2 -0
- package/auth/LoginState/index.d.ts +2 -0
- package/auth/MfaState/index.d.ts +10 -0
- package/auth/ProfileState/index.d.ts +2 -0
- package/auth/ResetPhoneNumberState/index.d.ts +2 -0
- package/auth/RolesState/index.d.ts +2 -0
- package/auth/SSOState/index.d.ts +2 -0
- package/auth/SecurityPolicyState/index.d.ts +11 -0
- package/auth/SessionsState/index.d.ts +96 -0
- package/auth/SessionsState/interfaces.d.ts +13 -0
- package/auth/SessionsState/saga.d.ts +2 -0
- package/auth/SignUp/index.d.ts +2 -0
- package/auth/SocialLogins/index.d.ts +2 -0
- package/auth/TeamState/index.d.ts +2 -0
- package/auth/TenantsState/index.d.ts +10 -2
- package/auth/dummy.d.ts +2 -0
- package/auth/index.d.ts +11 -0
- package/auth/index.js +139 -36
- package/auth/interfaces.d.ts +2 -0
- package/auth/reducer.d.ts +11 -1
- package/auth/utils.d.ts +4 -0
- package/index.js +1 -1
- package/node/auth/index.js +4 -1
- package/node/{index-6bd6499d.js → index-7cc852ed.js} +173 -67
- package/node/index.js +4 -1
- package/node/toolkit/index.js +1 -1
- package/package.json +1 -1
- package/toolkit/index.d.ts +1 -1
package/auth/index.js
CHANGED
|
@@ -133,11 +133,11 @@ const loginState = {
|
|
|
133
133
|
email: '',
|
|
134
134
|
tenants: [],
|
|
135
135
|
};
|
|
136
|
-
const reducers$
|
|
136
|
+
const reducers$g = {
|
|
137
137
|
setLoginState: typeReducerForKey('loginState'),
|
|
138
138
|
resetLoginState: resetStateByKey('loginState', { loginState }),
|
|
139
139
|
};
|
|
140
|
-
const actions$
|
|
140
|
+
const actions$h = {
|
|
141
141
|
requestAuthorize: createAction(`${authStoreName}/requestAuthorize`, (payload = false) => ({ payload })),
|
|
142
142
|
requestAuthorizeSSR: createAction(`${authStoreName}/requestAuthorizeSSR`, (payload) => ({ payload })),
|
|
143
143
|
requestHostedLoginAuthorize: createAction(`${authStoreName}/requestHostedLoginAuthorize`),
|
|
@@ -179,12 +179,12 @@ const activateState = {
|
|
|
179
179
|
loading: false,
|
|
180
180
|
},
|
|
181
181
|
};
|
|
182
|
-
const reducers$
|
|
182
|
+
const reducers$f = {
|
|
183
183
|
setActivateState: typeReducerForKey('activateState'),
|
|
184
184
|
resetActivateState: resetStateByKey('activateState', { activateState }),
|
|
185
185
|
setActivateStrategyState: typeReducerNestedKey('activateState', 'activationStrategy'),
|
|
186
186
|
};
|
|
187
|
-
const actions$
|
|
187
|
+
const actions$g = {
|
|
188
188
|
activateAccount: createAction(`${authStoreName}/activateAccount`, (payload) => ({ payload })),
|
|
189
189
|
preActivateAccount: createAction(`${authStoreName}/preActivateAccount`, (payload) => ({ payload })),
|
|
190
190
|
getActivateAccountStrategy: createAction(`${authStoreName}/getActivateAccountStrategy`, (payload) => ({ payload })),
|
|
@@ -205,13 +205,13 @@ var AcceptInvitationStep;
|
|
|
205
205
|
const acceptInvitationState = {
|
|
206
206
|
step: AcceptInvitationStep.validate,
|
|
207
207
|
};
|
|
208
|
-
const reducers$
|
|
208
|
+
const reducers$e = {
|
|
209
209
|
setAcceptInvitationState: typeReducerForKey('acceptInvitationState'),
|
|
210
210
|
resetAcceptInvitationState: resetStateByKey('acceptInvitationState', {
|
|
211
211
|
acceptInvitationState,
|
|
212
212
|
}),
|
|
213
213
|
};
|
|
214
|
-
const actions$
|
|
214
|
+
const actions$f = {
|
|
215
215
|
acceptInvitation: createAction(`${authStoreName}/acceptInvitation`, (payload) => ({ payload })),
|
|
216
216
|
};
|
|
217
217
|
|
|
@@ -227,11 +227,11 @@ const forgotPasswordState = {
|
|
|
227
227
|
email: '',
|
|
228
228
|
passwordConfig: null,
|
|
229
229
|
};
|
|
230
|
-
const reducers$
|
|
230
|
+
const reducers$d = {
|
|
231
231
|
setForgotPasswordState: typeReducerForKey('forgotPasswordState'),
|
|
232
232
|
resetForgotPasswordState: resetStateByKey('forgotPasswordState', { forgotPasswordState }),
|
|
233
233
|
};
|
|
234
|
-
const actions$
|
|
234
|
+
const actions$e = {
|
|
235
235
|
forgotPassword: createAction(`${authStoreName}/forgotPassword`, (payload) => ({ payload })),
|
|
236
236
|
resetPassword: createAction(`${authStoreName}/resetPassword`, (payload) => ({ payload })),
|
|
237
237
|
loadPasswordConfig: createAction(`${authStoreName}/loadPasswordConfig`, (payload) => ({
|
|
@@ -250,11 +250,11 @@ const resetPhoneNumberState = {
|
|
|
250
250
|
step: ResetPhoneNumberStep.ResetPhoneNumber,
|
|
251
251
|
loading: false,
|
|
252
252
|
};
|
|
253
|
-
const reducers$
|
|
253
|
+
const reducers$c = {
|
|
254
254
|
setResetPhoneNumberState: typeReducerForKey('resetPhoneNumberState'),
|
|
255
255
|
resetResetPhoneNumberState: resetStateByKey('resetPhoneNumberState', { resetPhoneNumberState }),
|
|
256
256
|
};
|
|
257
|
-
const actions$
|
|
257
|
+
const actions$d = {
|
|
258
258
|
resetPhoneNumber: createAction(`${authStoreName}/resetPhoneNumber`, (payload) => ({ payload })),
|
|
259
259
|
verifyResetPhoneNumber: createAction(`${authStoreName}/verifyResetPhoneNumber`, (payload) => ({ payload })),
|
|
260
260
|
changePhoneNumber: createAction(`${authStoreName}/changePhoneNumber`, (payload) => ({ payload })),
|
|
@@ -268,13 +268,13 @@ const ssoState = {
|
|
|
268
268
|
loaders: {},
|
|
269
269
|
ssoConfigurations: []
|
|
270
270
|
};
|
|
271
|
-
const reducers$
|
|
271
|
+
const reducers$b = {
|
|
272
272
|
setSSOLoader: loadersReducerForKey('ssoState'),
|
|
273
273
|
setSSOError: errorsReducerForKey('ssoState'),
|
|
274
274
|
setSSOState: typeReducerForKey('ssoState'),
|
|
275
275
|
resetSSOState: resetStateByKey('ssoState', { ssoState }),
|
|
276
276
|
};
|
|
277
|
-
const actions$
|
|
277
|
+
const actions$c = {
|
|
278
278
|
loadSSOConfigurationsV2: createAction(`${authStoreName}/loadSSOConfigurationsV2`),
|
|
279
279
|
saveSSOConfigurationV2: createAction(`${authStoreName}/saveSSOConfigurationV2`, (payload) => ({ payload })),
|
|
280
280
|
updateSSOConfiguration: createAction(`${authStoreName}/updateSSOConfiguration`, (payload) => ({ payload })),
|
|
@@ -308,11 +308,11 @@ const profileState = {
|
|
|
308
308
|
loading: false,
|
|
309
309
|
error: null,
|
|
310
310
|
};
|
|
311
|
-
const reducers$
|
|
311
|
+
const reducers$a = {
|
|
312
312
|
setProfileState: typeReducerForKey('profileState'),
|
|
313
313
|
resetProfileState: resetStateByKey('profileState', { profileState }),
|
|
314
314
|
};
|
|
315
|
-
const actions$
|
|
315
|
+
const actions$b = {
|
|
316
316
|
loadProfile: createAction(`${authStoreName}/loadProfile`),
|
|
317
317
|
saveProfile: createAction(`${authStoreName}/saveProfile`, (payload) => ({ payload })),
|
|
318
318
|
changePassword: createAction(`${authStoreName}/changePassword`, (payload) => ({
|
|
@@ -330,11 +330,11 @@ const mfaState = {
|
|
|
330
330
|
step: MFAStep.verify,
|
|
331
331
|
loading: false,
|
|
332
332
|
};
|
|
333
|
-
const reducers$
|
|
333
|
+
const reducers$9 = {
|
|
334
334
|
setMfaState: typeReducerForKey('mfaState'),
|
|
335
335
|
resetMfaState: resetStateByKey('mfaState', { mfaState }),
|
|
336
336
|
};
|
|
337
|
-
const actions$
|
|
337
|
+
const actions$a = {
|
|
338
338
|
enrollMfa: createAction(`${authStoreName}/enrollMfa`),
|
|
339
339
|
verifyMfa: createAction(`${authStoreName}/verifyMfa`, (payload) => ({
|
|
340
340
|
payload,
|
|
@@ -377,13 +377,13 @@ const teamState = {
|
|
|
377
377
|
open: false,
|
|
378
378
|
},
|
|
379
379
|
};
|
|
380
|
-
const reducers$
|
|
380
|
+
const reducers$8 = {
|
|
381
381
|
setTeamLoader: loadersReducerForKey('teamState'),
|
|
382
382
|
setTeamError: errorsReducerForKey('teamState'),
|
|
383
383
|
setTeamState: typeReducerForKey('teamState'),
|
|
384
384
|
resetTeamState: resetStateByKey('teamState', { teamState }),
|
|
385
385
|
};
|
|
386
|
-
const actions$
|
|
386
|
+
const actions$9 = {
|
|
387
387
|
loadUsers: createAction(`${authStoreName}/loadUsers`, (payload) => ({ payload })),
|
|
388
388
|
loadAllSubTenantsUsers: createAction(`${authStoreName}/loadAllSubTenantsUsers`, (payload) => ({ payload })),
|
|
389
389
|
loadRoles: createAction(`${authStoreName}/loadRoles`, (payload) => ({ payload })),
|
|
@@ -420,11 +420,11 @@ const socialLoginState = {
|
|
|
420
420
|
loading: false,
|
|
421
421
|
error: '',
|
|
422
422
|
};
|
|
423
|
-
const reducers$
|
|
423
|
+
const reducers$7 = {
|
|
424
424
|
setSocialLoginsState: typeReducerForKey('socialLoginState'),
|
|
425
425
|
resetSocialLoginsState: resetStateByKey('socialLoginState', { socialLoginState }),
|
|
426
426
|
};
|
|
427
|
-
const actions$
|
|
427
|
+
const actions$8 = {
|
|
428
428
|
loadSocialLoginsConfiguration: createAction(`${authStoreName}/loadSocialLoginsConfiguration`),
|
|
429
429
|
loadSocialLoginsConfigurationV2: createAction(`${authStoreName}/loadSocialLoginsConfigurationV2`),
|
|
430
430
|
loginViaSocialLogin: createAction(`${authStoreName}/loginViaSocialLogin`, (payload) => ({
|
|
@@ -448,11 +448,11 @@ const signUpState = {
|
|
|
448
448
|
firstLoad: true,
|
|
449
449
|
stage: SignUpStage.SignUp,
|
|
450
450
|
};
|
|
451
|
-
const reducers$
|
|
451
|
+
const reducers$6 = {
|
|
452
452
|
setSignUpState: typeReducerForKey('signUpState'),
|
|
453
453
|
resetSignUpState: resetStateByKey('signUpState', { signUpState }),
|
|
454
454
|
};
|
|
455
|
-
const actions$
|
|
455
|
+
const actions$7 = {
|
|
456
456
|
signUpUser: createAction(`${authStoreName}/signUpUser`, (payload) => ({ payload })),
|
|
457
457
|
resetSignUpStateSoft: createAction(`${authStoreName}/resetSignUpStateSoft`),
|
|
458
458
|
};
|
|
@@ -478,13 +478,13 @@ const apiTokensState = {
|
|
|
478
478
|
permissions: [],
|
|
479
479
|
errors: {},
|
|
480
480
|
};
|
|
481
|
-
const reducers$
|
|
481
|
+
const reducers$5 = {
|
|
482
482
|
setApiTokensLoader: loadersReducerForKey('apiTokensState'),
|
|
483
483
|
setApiTokensError: errorsReducerForKey('apiTokensState'),
|
|
484
484
|
setApiTokensState: typeReducerForKey('apiTokensState'),
|
|
485
485
|
resetApiTokensState: resetStateByKey('apiTokensState', { apiTokensState }),
|
|
486
486
|
};
|
|
487
|
-
const actions$
|
|
487
|
+
const actions$6 = {
|
|
488
488
|
loadApiTokens: createAction(`${authStoreName}/loadApiTokens`, (payload) => ({
|
|
489
489
|
payload,
|
|
490
490
|
})),
|
|
@@ -526,7 +526,7 @@ const securityPolicyState = {
|
|
|
526
526
|
loading: true,
|
|
527
527
|
},
|
|
528
528
|
};
|
|
529
|
-
const reducers$
|
|
529
|
+
const reducers$4 = {
|
|
530
530
|
setSecurityPolicyState: typeReducerForKey('securityPolicyState'),
|
|
531
531
|
setSecurityPolicyGlobalState: typeReducerNestedKey('securityPolicyState', 'globalPolicy'),
|
|
532
532
|
setSecurityPolicyPublicState: typeReducerNestedKey('securityPolicyState', 'publicPolicy'),
|
|
@@ -539,7 +539,7 @@ const reducers$3 = {
|
|
|
539
539
|
setSecurityPolicyPasswordState: typeReducerNestedKey('securityPolicyState', 'passwordPolicy'),
|
|
540
540
|
resetSecurityPolicyState: resetStateByKey('securityPolicyState', { securityPolicyState }),
|
|
541
541
|
};
|
|
542
|
-
const actions$
|
|
542
|
+
const actions$5 = {
|
|
543
543
|
loadSecurityPolicy: createAction(`${authStoreName}/loadSecurityPolicy`),
|
|
544
544
|
loadPublicSecurityPolicy: createAction(`${authStoreName}/loadPublicSecurityPolicy`),
|
|
545
545
|
loadSecurityPolicyMfa: createAction(`${authStoreName}/loadSecurityPolicyMfa`),
|
|
@@ -557,11 +557,11 @@ const actions$4 = {
|
|
|
557
557
|
const accountSettingsState = {
|
|
558
558
|
loading: false,
|
|
559
559
|
};
|
|
560
|
-
const reducers$
|
|
560
|
+
const reducers$3 = {
|
|
561
561
|
setAccountSettingsState: typeReducerForKey('accountSettingsState'),
|
|
562
562
|
resetAccountSettingsState: resetStateByKey('accountSettingsState', { accountSettingsState }),
|
|
563
563
|
};
|
|
564
|
-
const actions$
|
|
564
|
+
const actions$4 = {
|
|
565
565
|
loadAccountSettings: createAction(`${authStoreName}/loadAccountSettings`, (payload) => ({ payload })),
|
|
566
566
|
saveAccountSettings: createAction(`${authStoreName}/saveAccountSettings`, (payload) => ({ payload })),
|
|
567
567
|
};
|
|
@@ -572,11 +572,11 @@ const tenantsState = {
|
|
|
572
572
|
loading: true,
|
|
573
573
|
tenantTree: null,
|
|
574
574
|
};
|
|
575
|
-
const reducers$
|
|
575
|
+
const reducers$2 = {
|
|
576
576
|
setTenantsState: typeReducerForKey('tenantsState'),
|
|
577
577
|
resetTenantsState: resetStateByKey('tenantsState', { tenantsState }),
|
|
578
578
|
};
|
|
579
|
-
const actions$
|
|
579
|
+
const actions$3 = {
|
|
580
580
|
switchTenant: createAction(`${authStoreName}/switchTenant`, (payload) => ({ payload })),
|
|
581
581
|
loadTenants: createAction(`${authStoreName}/loadTenants`, (payload) => ({
|
|
582
582
|
payload,
|
|
@@ -595,11 +595,11 @@ const rolesState = {
|
|
|
595
595
|
permissions: [],
|
|
596
596
|
permissionCategories: [],
|
|
597
597
|
};
|
|
598
|
-
const reducers = {
|
|
598
|
+
const reducers$1 = {
|
|
599
599
|
setRolesState: typeReducerForKey('rolesState'),
|
|
600
600
|
resetRolesState: resetStateByKey('rolesState', { rolesState }),
|
|
601
601
|
};
|
|
602
|
-
const actions$
|
|
602
|
+
const actions$2 = {
|
|
603
603
|
loadRolesAndPermissions: createAction(`${authStoreName}/loadRoles`, (payload) => ({ payload })),
|
|
604
604
|
addRole: createAction(`${authStoreName}/addRole`, (payload) => ({ payload })),
|
|
605
605
|
updateRole: createAction(`${authStoreName}/updateRole`, (payload) => ({ payload })),
|
|
@@ -608,6 +608,20 @@ const actions$1 = {
|
|
|
608
608
|
attachPermissionToRoles: createAction(`${authStoreName}/attachPermissionToRoles`, (payload) => ({ payload })),
|
|
609
609
|
};
|
|
610
610
|
|
|
611
|
+
const sessionsState = {
|
|
612
|
+
loading: false,
|
|
613
|
+
sessions: [],
|
|
614
|
+
};
|
|
615
|
+
const reducers = {
|
|
616
|
+
setSessionsState: typeReducerForKey('sessionsState'),
|
|
617
|
+
resetSessionsState: resetStateByKey('sessionsState', { sessionsState }),
|
|
618
|
+
};
|
|
619
|
+
const actions$1 = {
|
|
620
|
+
loadUserSessions: createAction(`${authStoreName}/loadUserSessions`),
|
|
621
|
+
deleteUserSession: createAction(`${authStoreName}/deleteUserSession`, (payload) => ({ payload })),
|
|
622
|
+
deleteAllUserSessions: createAction(`${authStoreName}/deleteAllUserSessions`),
|
|
623
|
+
};
|
|
624
|
+
|
|
611
625
|
const reinitializeState = {
|
|
612
626
|
isAuthenticated: false,
|
|
613
627
|
isLoading: true,
|
|
@@ -628,7 +642,8 @@ const reinitializeState = {
|
|
|
628
642
|
accountSettingsState,
|
|
629
643
|
tenantsState,
|
|
630
644
|
rolesState,
|
|
631
|
-
resetPhoneNumberState
|
|
645
|
+
resetPhoneNumberState,
|
|
646
|
+
sessionsState,
|
|
632
647
|
};
|
|
633
648
|
const initialState = Object.assign({ routes: {
|
|
634
649
|
authenticatedUrl: '/',
|
|
@@ -650,9 +665,9 @@ const initialState = Object.assign({ routes: {
|
|
|
650
665
|
const { reducer, actions: sliceActions } = createSlice({
|
|
651
666
|
name: authStoreName,
|
|
652
667
|
initialState,
|
|
653
|
-
reducers: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ resetState: (state) => (Object.assign(Object.assign({}, state), reinitializeState)), setState: (state, { payload }) => (Object.assign(Object.assign({}, state), payload)), setUser: typeReducer('user') }, reducers$
|
|
668
|
+
reducers: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ resetState: (state) => (Object.assign(Object.assign({}, state), reinitializeState)), setState: (state, { payload }) => (Object.assign(Object.assign({}, state), payload)), setUser: typeReducer('user') }, reducers$g), reducers$7), reducers$f), reducers$e), reducers$d), reducers$c), reducers$6), reducers$a), reducers$b), reducers$9), reducers$8), reducers$5), reducers$4), reducers$3), reducers$2), reducers$1), reducers),
|
|
654
669
|
});
|
|
655
|
-
const actions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sliceActions), actions$
|
|
670
|
+
const actions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, sliceActions), actions$h), actions$8), actions$g), actions$f), actions$e), actions$d), actions$7), actions$b), actions$c), actions$a), actions$9), actions$6), actions$5), actions$4), actions$3), actions$2), actions$1);
|
|
656
671
|
|
|
657
672
|
var SSOStateKeys;
|
|
658
673
|
(function (SSOStateKeys) {
|
|
@@ -950,6 +965,33 @@ const tenantsDemo = [
|
|
|
950
965
|
currency: undefined,
|
|
951
966
|
logo: undefined,
|
|
952
967
|
},
|
|
968
|
+
];
|
|
969
|
+
const sessionsMock = [
|
|
970
|
+
{
|
|
971
|
+
id: `laptop`,
|
|
972
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
973
|
+
createdAt: new Date(),
|
|
974
|
+
ipAddress: "190.194.88.251",
|
|
975
|
+
current: true,
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
id: `iphone`,
|
|
979
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 15_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.2 Mobile/15E148 Safari/604.1",
|
|
980
|
+
createdAt: new Date(Date.now() - 10000),
|
|
981
|
+
ipAddress: "191.49.203.21",
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
id: `tablet`,
|
|
985
|
+
userAgent: "Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36",
|
|
986
|
+
createdAt: new Date(Date.now() - 30000),
|
|
987
|
+
ipAddress: "130.19.196.136",
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
id: `anotherlaptop`,
|
|
991
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.0 Safari/605.1.15",
|
|
992
|
+
createdAt: new Date(Date.now() - 1002232300),
|
|
993
|
+
ipAddress: "2.228.163.92",
|
|
994
|
+
}
|
|
953
995
|
];
|
|
954
996
|
|
|
955
997
|
var UserVeirifedOriginTypes;
|
|
@@ -4104,6 +4146,65 @@ function* resetPhoneNumberSagas() {
|
|
|
4104
4146
|
yield takeLeading(actions.changePhoneNumber, changePhoneNumber);
|
|
4105
4147
|
}
|
|
4106
4148
|
|
|
4149
|
+
function* loadCurrentUserSessions() {
|
|
4150
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4151
|
+
try {
|
|
4152
|
+
const sessions = yield call(api.auth.getCurrentUserSessions);
|
|
4153
|
+
yield put(actions.setSessionsState({ sessions, loading: false }));
|
|
4154
|
+
}
|
|
4155
|
+
catch (e) {
|
|
4156
|
+
yield put(actions.setSessionsState({ error: e, loading: false }));
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
function* deleteUserSession({ payload: { id } }) {
|
|
4160
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4161
|
+
try {
|
|
4162
|
+
yield call(api.auth.deleteSessionForUser, id);
|
|
4163
|
+
yield put(actions.loadUserSessions());
|
|
4164
|
+
}
|
|
4165
|
+
catch (e) {
|
|
4166
|
+
yield put(actions.setSessionsState({ error: e, loading: false }));
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
function* deleteAllUserSessions() {
|
|
4170
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4171
|
+
try {
|
|
4172
|
+
yield call(api.auth.deleteAllSessionsForUser);
|
|
4173
|
+
yield put(actions.loadUserSessions());
|
|
4174
|
+
}
|
|
4175
|
+
catch (e) {
|
|
4176
|
+
yield put(actions.setSessionsState({ error: e, loading: false }));
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
function* sessionsSaga() {
|
|
4180
|
+
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessions);
|
|
4181
|
+
yield takeLatest(actions.deleteUserSession, deleteUserSession);
|
|
4182
|
+
yield takeLatest(actions.deleteAllUserSessions, deleteAllUserSessions);
|
|
4183
|
+
}
|
|
4184
|
+
/*********************************
|
|
4185
|
+
* Preview Sagas
|
|
4186
|
+
*********************************/
|
|
4187
|
+
function* loadCurrentUserSessionsMock() {
|
|
4188
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4189
|
+
yield put(actions.setSessionsState({ sessions: sessionsMock, loading: false }));
|
|
4190
|
+
}
|
|
4191
|
+
function* deleteUserSessionMock({ payload: { id } }) {
|
|
4192
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4193
|
+
const currentSessions = yield select((state) => { var _a; return (_a = state.auth.sessionsState.sessions) !== null && _a !== void 0 ? _a : []; });
|
|
4194
|
+
const newSessions = currentSessions.filter(s => s.id !== id);
|
|
4195
|
+
yield put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4196
|
+
}
|
|
4197
|
+
function* deleteAllUserSessionsMock() {
|
|
4198
|
+
yield put(actions.setSessionsState({ loading: true, error: null }));
|
|
4199
|
+
const newSessions = sessionsMock.filter(s => s.current);
|
|
4200
|
+
yield put(actions.setSessionsState({ sessions: newSessions, loading: false }));
|
|
4201
|
+
}
|
|
4202
|
+
function* sessionsSagaMock() {
|
|
4203
|
+
yield takeLatest(actions.loadUserSessions, loadCurrentUserSessionsMock);
|
|
4204
|
+
yield takeLatest(actions.deleteUserSession, deleteUserSessionMock);
|
|
4205
|
+
yield takeLatest(actions.deleteAllUserSessions, deleteAllUserSessionsMock);
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4107
4208
|
function* sagas() {
|
|
4108
4209
|
yield all([
|
|
4109
4210
|
call(loginSagas),
|
|
@@ -4123,6 +4224,7 @@ function* sagas() {
|
|
|
4123
4224
|
call(accountSettingsSaga),
|
|
4124
4225
|
call(tenantsSagas),
|
|
4125
4226
|
call(rolesSagas),
|
|
4227
|
+
call(sessionsSaga),
|
|
4126
4228
|
]);
|
|
4127
4229
|
}
|
|
4128
4230
|
function* mockSagas() {
|
|
@@ -4139,6 +4241,7 @@ function* mockSagas() {
|
|
|
4139
4241
|
call(teamSagasMock),
|
|
4140
4242
|
call(apiTokensSagaMock),
|
|
4141
4243
|
call(securityPolicySagasMock),
|
|
4244
|
+
call(sessionsSagaMock),
|
|
4142
4245
|
call(accountSettingsSagaMock),
|
|
4143
4246
|
call(tenantsSagasMock),
|
|
4144
4247
|
]);
|
|
@@ -4154,4 +4257,4 @@ var authStore = {
|
|
|
4154
4257
|
actions,
|
|
4155
4258
|
};
|
|
4156
4259
|
|
|
4157
|
-
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, AuthenticationTypes, ForgotPasswordStep, LoginFlow, LoginStep, MFAStep, QuickLoginStrategy, ResetPhoneNumberStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, UserVeirifedOriginTypes, actions$
|
|
4260
|
+
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, AuthenticationTypes, ForgotPasswordStep, LoginFlow, LoginStep, MFAStep, QuickLoginStrategy, ResetPhoneNumberStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, UserVeirifedOriginTypes, actions$f as acceptInvitationActions, reducers$e as acceptInvitationReducers, acceptInvitationState, actions$4 as accountSettingsActions, reducers$3 as accountSettingsReducers, accountSettingsState, actions$g as activateAccountActions, reducers$f as activateAccountReducers, activateState, actions$6 as apiTokensActions, reducers$5 as apiTokensReducers, apiTokensState, actions as authActions, initialState as authInitialState, mockSagas as authMockSagas, reducer as authReducers, sagas as authSagas, authStore as default, actions$e as forgotPasswordActions, reducers$d as forgotPasswordReducers, forgotPasswordState, actions$h as loginActions, reducers$g as loginReducers, loginState, actions$a as mfaActions, reducers$9 as mfaReducers, mfaState, actions$b as profileActions, reducers$a as profileReducers, profileState, actions$d as resetPhoneNumberActions, reducers$c as resetPhoneNumberReducers, resetPhoneNumberState, actions$2 as rolesActions, reducers$1 as rolesReducers, rolesState, actions$5 as securityPolicyActions, reducers$4 as securityPolicyReducers, securityPolicyState, actions$1 as sessionsActions, reducers as sessionsReducers, sessionsState, actions$7 as signUpActions, reducers$6 as signUpReducers, signUpState, socialLoginState, actions$8 as socialLoginsActions, reducers$7 as socialLoginsReducer, actions$c as ssoActions, reducers$b as ssoReducers, ssoState, actions$9 as teamActions, reducers$8 as teamReducers, teamState, actions$3 as tenantsActions, reducers$2 as tenantsReducers, tenantsState };
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { AccountSettingsState } from './AccountSettingsState/interfaces';
|
|
|
15
15
|
import { TenantsState } from './TenantsState/interfaces';
|
|
16
16
|
import { RolesState } from './RolesState/interfaces';
|
|
17
17
|
import { ResetPhoneNumberState } from './ResetPhoneNumberState/interfaces';
|
|
18
|
+
import { SessionsState } from './SessionsState/interfaces';
|
|
18
19
|
export interface User extends IUserProfile {
|
|
19
20
|
accessToken: string;
|
|
20
21
|
refreshToken: string;
|
|
@@ -53,6 +54,7 @@ export interface AuthState extends Routes, PluginOptions {
|
|
|
53
54
|
accountSettingsState: AccountSettingsState;
|
|
54
55
|
tenantsState: TenantsState;
|
|
55
56
|
rolesState: RolesState;
|
|
57
|
+
sessionsState: SessionsState;
|
|
56
58
|
}
|
|
57
59
|
export declare type AuthPageRoutes = {
|
|
58
60
|
/**
|
package/auth/reducer.d.ts
CHANGED
|
@@ -15,8 +15,16 @@ import { AccountSettingsActions } from './AccountSettingsState';
|
|
|
15
15
|
import { TenantsActions } from './TenantsState';
|
|
16
16
|
import { RolesActions } from './RolesState';
|
|
17
17
|
import { ResetPhoneNumberActions } from './ResetPhoneNumberState';
|
|
18
|
+
import { SessionsActions } from './SessionsState';
|
|
18
19
|
declare const reducer: import("redux").Reducer<AuthState, import("redux").AnyAction>;
|
|
19
20
|
declare const actions: {
|
|
21
|
+
loadUserSessions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
22
|
+
deleteUserSession: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
23
|
+
id: string;
|
|
24
|
+
}], {
|
|
25
|
+
id: string;
|
|
26
|
+
}, string, never, never>;
|
|
27
|
+
deleteAllUserSessions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
20
28
|
loadRolesAndPermissions: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[({
|
|
21
29
|
silentLoading?: boolean | undefined;
|
|
22
30
|
} | undefined)?], {
|
|
@@ -277,6 +285,8 @@ declare const actions: {
|
|
|
277
285
|
callback?: ((data: import("@frontegg/rest-api").ICreateNewDeviceSessionResponse | null, error?: string | undefined) => void) | undefined;
|
|
278
286
|
}, string, never, never>;
|
|
279
287
|
webAuthnVerifyNewDeviceSession: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").IVerifyNewWebAuthnDevicePayload], import(".").IVerifyNewWebAuthnDevicePayload, string, never, never>;
|
|
288
|
+
setSessionsState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").SessionsState>], Partial<import(".").SessionsState>, string, never, never>;
|
|
289
|
+
resetSessionsState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
280
290
|
setRolesState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").RolesState>], Partial<import(".").RolesState>, string, never, never>;
|
|
281
291
|
resetRolesState: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
282
292
|
setTenantsState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[Partial<import(".").TenantsState>], Partial<import(".").TenantsState>, string, never, never>;
|
|
@@ -370,5 +380,5 @@ export declare type RootActions = {
|
|
|
370
380
|
resetState: () => void;
|
|
371
381
|
setUser: (user: User) => void;
|
|
372
382
|
};
|
|
373
|
-
export declare type AuthActions = RootActions & LoginActions & SocialLoginActions & ActivateAccountActions & AcceptInvitationActions & ForgotPasswordActions & ResetPhoneNumberActions & SignUpActions & ProfileActions & SSOActions & MfaActions & TeamActions & ApiTokensActions & SecurityPolicyActions & AccountSettingsActions & TenantsActions & RolesActions;
|
|
383
|
+
export declare type AuthActions = RootActions & LoginActions & SocialLoginActions & ActivateAccountActions & AcceptInvitationActions & ForgotPasswordActions & ResetPhoneNumberActions & SignUpActions & ProfileActions & SSOActions & MfaActions & TeamActions & ApiTokensActions & SecurityPolicyActions & AccountSettingsActions & TenantsActions & RolesActions & SessionsActions;
|
|
374
384
|
export { reducer, actions };
|
package/auth/utils.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare const resetStateByKey: <T>(key: keyof AuthState, initialState: Pa
|
|
|
25
25
|
accountSettingsState: import(".").AccountSettingsState;
|
|
26
26
|
tenantsState: import(".").TenantsState;
|
|
27
27
|
rolesState: import(".").RolesState;
|
|
28
|
+
sessionsState: import(".").SessionsState;
|
|
28
29
|
routes: import("./interfaces").AuthPageRoutes;
|
|
29
30
|
header?: any;
|
|
30
31
|
loaderComponent?: any;
|
|
@@ -57,6 +58,7 @@ export declare const typeReducer: <T>(key: keyof AuthState) => (state: AuthState
|
|
|
57
58
|
accountSettingsState: import(".").AccountSettingsState;
|
|
58
59
|
tenantsState: import(".").TenantsState;
|
|
59
60
|
rolesState: import(".").RolesState;
|
|
61
|
+
sessionsState: import(".").SessionsState;
|
|
60
62
|
routes: import("./interfaces").AuthPageRoutes;
|
|
61
63
|
header?: any;
|
|
62
64
|
loaderComponent?: any;
|
|
@@ -93,6 +95,7 @@ export declare const typeReducerForKey: <T>(key: keyof AuthState) => {
|
|
|
93
95
|
accountSettingsState: import(".").AccountSettingsState;
|
|
94
96
|
tenantsState: import(".").TenantsState;
|
|
95
97
|
rolesState: import(".").RolesState;
|
|
98
|
+
sessionsState: import(".").SessionsState;
|
|
96
99
|
routes: import("./interfaces").AuthPageRoutes;
|
|
97
100
|
header?: any;
|
|
98
101
|
loaderComponent?: any;
|
|
@@ -130,6 +133,7 @@ export declare const typeReducerNestedKey: <T, K>(key: keyof AuthState, nestedKe
|
|
|
130
133
|
accountSettingsState: import(".").AccountSettingsState;
|
|
131
134
|
tenantsState: import(".").TenantsState;
|
|
132
135
|
rolesState: import(".").RolesState;
|
|
136
|
+
sessionsState: import(".").SessionsState;
|
|
133
137
|
routes: import("./interfaces").AuthPageRoutes;
|
|
134
138
|
header?: any;
|
|
135
139
|
loaderComponent?: any;
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, AuthenticationTypes, ForgotPasswordStep, LoginFlow, LoginStep, MFAStep, QuickLoginStrategy, ResetPhoneNumberStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, UserVeirifedOriginTypes, acceptInvitationActions, acceptInvitationReducers, acceptInvitationState, accountSettingsActions, accountSettingsReducers, accountSettingsState, activateAccountActions, activateAccountReducers, activateState, apiTokensActions, apiTokensReducers, apiTokensState, default as auth, authActions, authInitialState, authMockSagas, authReducers, authSagas, forgotPasswordActions, forgotPasswordReducers, forgotPasswordState, loginActions, loginReducers, loginState, mfaActions, mfaReducers, mfaState, profileActions, profileReducers, profileState, resetPhoneNumberActions, resetPhoneNumberReducers, resetPhoneNumberState, rolesActions, rolesReducers, rolesState, securityPolicyActions, securityPolicyReducers, securityPolicyState, signUpActions, signUpReducers, signUpState, socialLoginState, socialLoginsActions, socialLoginsReducer, ssoActions, ssoReducers, ssoState, teamActions, teamReducers, teamState, tenantsActions, tenantsReducers, tenantsState } from './auth/index.js';
|
|
1
|
+
export { AcceptInvitationStep, ActivateAccountStep, ApiStateKeys, AuthenticationTypes, ForgotPasswordStep, LoginFlow, LoginStep, MFAStep, QuickLoginStrategy, ResetPhoneNumberStep, SSOStateKeys, SamlVendors, SignUpStage, TeamStateKeys, UserVeirifedOriginTypes, acceptInvitationActions, acceptInvitationReducers, acceptInvitationState, accountSettingsActions, accountSettingsReducers, accountSettingsState, activateAccountActions, activateAccountReducers, activateState, apiTokensActions, apiTokensReducers, apiTokensState, default as auth, authActions, authInitialState, authMockSagas, authReducers, authSagas, forgotPasswordActions, forgotPasswordReducers, forgotPasswordState, loginActions, loginReducers, loginState, mfaActions, mfaReducers, mfaState, profileActions, profileReducers, profileState, resetPhoneNumberActions, resetPhoneNumberReducers, resetPhoneNumberState, rolesActions, rolesReducers, rolesState, securityPolicyActions, securityPolicyReducers, securityPolicyState, sessionsActions, sessionsReducers, sessionsState, signUpActions, signUpReducers, signUpState, socialLoginState, socialLoginsActions, socialLoginsReducer, ssoActions, ssoReducers, ssoState, teamActions, teamReducers, teamState, tenantsActions, tenantsReducers, tenantsState } from './auth/index.js';
|
|
2
2
|
export { auditLogsActions, auditLogsReducers, auditLogsState, default as audits, auditsActions, auditsInitialState, auditsMetadataActions, auditsMetadataReducers, auditsMetadataState, auditsMockSagas, auditsReducers, auditsSagas } from './audits/index.js';
|
|
3
3
|
export { default as connectivity, connectivityActions, connectivityInitialState, connectivityReducers, connectivitySagas } from './connectivity/index.js';
|
|
4
4
|
export { PaymentMethodType, PaymentProvider, SubscriptionCancellationPolicy, SubscriptionStatus, subscriptionActions, subscriptionInitialState, subscriptionReducers, subscriptionSagas, subscriptionSagasMock, default as subscriptions } from './subscriptions/index.js';
|
package/node/auth/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var auth_index = require('../index-
|
|
5
|
+
var auth_index = require('../index-7cc852ed.js');
|
|
6
6
|
var constants = require('../constants-52e37c08.js');
|
|
7
7
|
var restApi = require('@frontegg/rest-api');
|
|
8
8
|
require('@reduxjs/toolkit');
|
|
@@ -147,6 +147,9 @@ exports.rolesState = auth_index.rolesState;
|
|
|
147
147
|
exports.securityPolicyActions = auth_index.actions$13;
|
|
148
148
|
exports.securityPolicyReducers = auth_index.reducers$12;
|
|
149
149
|
exports.securityPolicyState = auth_index.securityPolicyState;
|
|
150
|
+
exports.sessionsActions = auth_index.actions$17;
|
|
151
|
+
exports.sessionsReducers = auth_index.reducers$16;
|
|
152
|
+
exports.sessionsState = auth_index.sessionsState;
|
|
150
153
|
exports.signUpActions = auth_index.actions$11;
|
|
151
154
|
exports.signUpReducers = auth_index.reducers$10;
|
|
152
155
|
exports.signUpState = auth_index.signUpState;
|