@frontegg/redux-store 5.78.1 → 5.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/LoginState/index.d.ts +8 -2
- package/auth/index.d.ts +5 -1
- package/auth/index.js +10 -3
- package/auth/reducer.d.ts +5 -1
- package/node/auth/index.js +1 -1
- package/node/{index-91a6e5b6.js → index-179542cb.js} +10 -3
- package/node/index.js +1 -1
- package/node/toolkit/index.js +1 -1
- package/package.json +1 -1
|
@@ -95,7 +95,11 @@ declare const actions: {
|
|
|
95
95
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ILoginWithMfa, boolean>], WithCallback<ILoginWithMfa, boolean>, string, never, never>;
|
|
96
96
|
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IRecoverMFAToken], IRecoverMFAToken, string, never, never>;
|
|
97
97
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
98
|
-
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(
|
|
98
|
+
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(WithCallback<{
|
|
99
|
+
callbackTimeout?: number | undefined;
|
|
100
|
+
}, boolean> | undefined)?], WithCallback<{
|
|
101
|
+
callbackTimeout?: number | undefined;
|
|
102
|
+
}, boolean> | undefined, string, never, never>;
|
|
99
103
|
checkIfAllowToRememberMfaDevice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
100
104
|
mfaToken: string;
|
|
101
105
|
}], {
|
|
@@ -137,7 +141,9 @@ declare type DispatchedActions = {
|
|
|
137
141
|
loginWithMfa: (payload: WithCallback<ILoginWithMfa>) => void;
|
|
138
142
|
recoverMfa: (payload: IRecoverMFAToken) => void;
|
|
139
143
|
logout: (payload?: () => void) => void;
|
|
140
|
-
silentLogout: (payload?:
|
|
144
|
+
silentLogout: (payload?: WithCallback<{
|
|
145
|
+
callbackTimeout?: number;
|
|
146
|
+
}>) => void;
|
|
141
147
|
checkIfAllowToRememberMfaDevice: (payload: {
|
|
142
148
|
mfaToken: string;
|
|
143
149
|
}) => void;
|
package/auth/index.d.ts
CHANGED
|
@@ -303,7 +303,11 @@ declare const _default: {
|
|
|
303
303
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
|
|
304
304
|
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IRecoverMFAToken], import("@frontegg/rest-api").IRecoverMFAToken, string, never, never>;
|
|
305
305
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
306
|
-
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((
|
|
306
|
+
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("../interfaces").WithCallback<{
|
|
307
|
+
callbackTimeout?: number | undefined;
|
|
308
|
+
}, boolean> | undefined)?], import("../interfaces").WithCallback<{
|
|
309
|
+
callbackTimeout?: number | undefined;
|
|
310
|
+
}, boolean> | undefined, string, never, never>;
|
|
307
311
|
checkIfAllowToRememberMfaDevice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
308
312
|
mfaToken: string;
|
|
309
313
|
}], {
|
package/auth/index.js
CHANGED
|
@@ -1518,10 +1518,16 @@ function* refreshTokenEmbedded() {
|
|
|
1518
1518
|
isAuthenticated: true,
|
|
1519
1519
|
loginState: Object.assign(Object.assign({}, loginState), { quickLoginToRegister, flow: shouldNavigateToRegisterQuicKLogin ? LoginFlow.RegisterQuickLogin : LoginFlow.Login })
|
|
1520
1520
|
}));
|
|
1521
|
+
const url = new URL(window === null || window === void 0 ? void 0 : window.location.href);
|
|
1522
|
+
const invitationToken = url.searchParams.get('invitationToken');
|
|
1523
|
+
const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl];
|
|
1524
|
+
if (!invitationToken) {
|
|
1525
|
+
redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
|
|
1526
|
+
}
|
|
1521
1527
|
if (shouldNavigateToRegisterQuicKLogin) {
|
|
1522
1528
|
onRedirectTo(routes.loginUrl);
|
|
1523
1529
|
}
|
|
1524
|
-
else if (
|
|
1530
|
+
else if (redirectRoutes
|
|
1525
1531
|
.some(url => url && window.location.pathname.endsWith(url))) {
|
|
1526
1532
|
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
1527
1533
|
onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
|
|
@@ -2038,12 +2044,13 @@ function* logout({ payload }) {
|
|
|
2038
2044
|
payload === null || payload === void 0 ? void 0 : payload();
|
|
2039
2045
|
}
|
|
2040
2046
|
function* silentLogout({ payload }) {
|
|
2047
|
+
var _a;
|
|
2041
2048
|
try {
|
|
2042
2049
|
yield call(api.auth.logout);
|
|
2043
2050
|
}
|
|
2044
|
-
catch (
|
|
2051
|
+
catch (_b) {
|
|
2045
2052
|
}
|
|
2046
|
-
setTimeout(() => payload === null || payload === void 0 ? void 0 : payload(), 500);
|
|
2053
|
+
setTimeout(() => { var _a; return (_a = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _a === void 0 ? void 0 : _a.call(payload, true); }, (_a = payload === null || payload === void 0 ? void 0 : payload.callbackTimeout) !== null && _a !== void 0 ? _a : 500);
|
|
2047
2054
|
}
|
|
2048
2055
|
function* loginSagas() {
|
|
2049
2056
|
yield takeLeading(actions.requestAuthorize, requestAuthorize);
|
package/auth/reducer.d.ts
CHANGED
|
@@ -273,7 +273,11 @@ declare const actions: {
|
|
|
273
273
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("../interfaces").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
|
|
274
274
|
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IRecoverMFAToken], import("@frontegg/rest-api").IRecoverMFAToken, string, never, never>;
|
|
275
275
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
276
|
-
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((
|
|
276
|
+
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("../interfaces").WithCallback<{
|
|
277
|
+
callbackTimeout?: number | undefined;
|
|
278
|
+
}, boolean> | undefined)?], import("../interfaces").WithCallback<{
|
|
279
|
+
callbackTimeout?: number | undefined;
|
|
280
|
+
}, boolean> | undefined, string, never, never>;
|
|
277
281
|
checkIfAllowToRememberMfaDevice: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
278
282
|
mfaToken: string;
|
|
279
283
|
}], {
|
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-179542cb.js');
|
|
6
6
|
var constants = require('../constants-52e37c08.js');
|
|
7
7
|
var restApi = require('@frontegg/rest-api');
|
|
8
8
|
require('@reduxjs/toolkit');
|
|
@@ -1437,10 +1437,16 @@ function* refreshTokenEmbedded() {
|
|
|
1437
1437
|
isAuthenticated: true,
|
|
1438
1438
|
loginState: Object.assign(Object.assign({}, loginState), { quickLoginToRegister, flow: shouldNavigateToRegisterQuicKLogin ? exports.LoginFlow.RegisterQuickLogin : exports.LoginFlow.Login })
|
|
1439
1439
|
}));
|
|
1440
|
+
const url = new URL(window === null || window === void 0 ? void 0 : window.location.href);
|
|
1441
|
+
const invitationToken = url.searchParams.get('invitationToken');
|
|
1442
|
+
const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl];
|
|
1443
|
+
if (!invitationToken) {
|
|
1444
|
+
redirectRoutes.push(routes.loginUrl, routes.signUpUrl);
|
|
1445
|
+
}
|
|
1440
1446
|
if (shouldNavigateToRegisterQuicKLogin) {
|
|
1441
1447
|
onRedirectTo(routes.loginUrl);
|
|
1442
1448
|
}
|
|
1443
|
-
else if (
|
|
1449
|
+
else if (redirectRoutes
|
|
1444
1450
|
.some(url => url && window.location.pathname.endsWith(url))) {
|
|
1445
1451
|
if (loginState.isNewUser && routes.signUpSuccessUrl && routes.socialLoginCallbackUrl === window.location.pathname) {
|
|
1446
1452
|
onRedirectTo(routes.signUpSuccessUrl, { refresh: routes.signUpSuccessUrl.startsWith('http') });
|
|
@@ -1957,12 +1963,13 @@ function* logout({ payload }) {
|
|
|
1957
1963
|
payload === null || payload === void 0 ? void 0 : payload();
|
|
1958
1964
|
}
|
|
1959
1965
|
function* silentLogout({ payload }) {
|
|
1966
|
+
var _a;
|
|
1960
1967
|
try {
|
|
1961
1968
|
yield effects.call(restApi.api.auth.logout);
|
|
1962
1969
|
}
|
|
1963
|
-
catch (
|
|
1970
|
+
catch (_b) {
|
|
1964
1971
|
}
|
|
1965
|
-
setTimeout(() => payload === null || payload === void 0 ? void 0 : payload(), 500);
|
|
1972
|
+
setTimeout(() => { var _a; return (_a = payload === null || payload === void 0 ? void 0 : payload.callback) === null || _a === void 0 ? void 0 : _a.call(payload, true); }, (_a = payload === null || payload === void 0 ? void 0 : payload.callbackTimeout) !== null && _a !== void 0 ? _a : 500);
|
|
1966
1973
|
}
|
|
1967
1974
|
function* loginSagas() {
|
|
1968
1975
|
yield effects.takeLeading(actions.requestAuthorize, requestAuthorize);
|
package/node/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-179542cb.js');
|
|
6
6
|
var audits_index = require('./audits/index.js');
|
|
7
7
|
var connectivity_index = require('./connectivity/index.js');
|
|
8
8
|
var subscriptions_index = require('./subscriptions/index.js');
|
package/node/toolkit/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-179542cb.js');
|
|
6
6
|
var toolkit = require('@reduxjs/toolkit');
|
|
7
7
|
var createSagaMiddleware = require('redux-saga');
|
|
8
8
|
var effects = require('redux-saga/effects');
|