@frontegg/redux-store 7.111.0-alpha.3 → 7.111.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auth/LoginState/actions/index.js +19 -21
- package/index.js +1 -1
- package/node/auth/LoginState/actions/index.js +18 -20
- package/node/index.js +1 -1
- package/package.json +2 -2
|
@@ -26,7 +26,7 @@ import { LoginFlow, LoginStep } from '../interfaces';
|
|
|
26
26
|
import { base64urlDecode, deepResetState, delay, errorHandler, errorTraceId, GTMEventAction, publicKeyCredentialToJSON, reportGTMEvent, retryIfNeeded, withRetryConfig } from '../../../helpers';
|
|
27
27
|
import { initialState } from '../state';
|
|
28
28
|
import { getSearchParam, isEmailPayload, isUsernamePayload, shouldShowPasswordRotationPromptFunc, TENANT_ID_PARAM_KEY } from '../helpers';
|
|
29
|
-
import { AuthStrategyEnum, ContextHolder, FeatureFlags,
|
|
29
|
+
import { AuthStrategyEnum, ContextHolder, FeatureFlags, removeTabTenantFromSessionStorage, WebAuthnDeviceType } from '@frontegg/rest-api';
|
|
30
30
|
import hostedLoginAuthorizeActions from './hostedLoginAuthorize.actions';
|
|
31
31
|
import { FronteggNativeModule, isEntitlementsDeeplyEqual } from '../../../toolkit';
|
|
32
32
|
import { REQUEST_NAME, UserVerifiedOriginTypes } from '../../interfaces';
|
|
@@ -51,13 +51,10 @@ export default ((store, api, sharedActions) => {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
const
|
|
55
|
-
const body = _extends({
|
|
54
|
+
const body = {
|
|
56
55
|
grant_type: 'refresh_token',
|
|
57
56
|
refresh_token: user == null ? void 0 : user.refreshToken
|
|
58
|
-
}
|
|
59
|
-
tenantId: tabTenantId
|
|
60
|
-
} : {});
|
|
57
|
+
};
|
|
61
58
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
62
59
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
63
60
|
actions.afterAuthenticationStateUpdate(_extends({}, response, {
|
|
@@ -409,23 +406,27 @@ export default ((store, api, sharedActions) => {
|
|
|
409
406
|
}, 2000);
|
|
410
407
|
}
|
|
411
408
|
} else {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
409
|
+
await ssoPreloginFailed(_extends({}, username ? {
|
|
410
|
+
username
|
|
411
|
+
} : {
|
|
412
|
+
email: email != null ? email : ''
|
|
413
|
+
}, {
|
|
415
414
|
recaptchaToken,
|
|
416
415
|
callback,
|
|
417
416
|
invitationToken
|
|
418
|
-
});
|
|
417
|
+
}));
|
|
419
418
|
}
|
|
420
419
|
} catch (e) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
420
|
+
await ssoPreloginFailed(_extends({}, username ? {
|
|
421
|
+
username
|
|
422
|
+
} : {
|
|
423
|
+
email: email != null ? email : ''
|
|
424
|
+
}, {
|
|
424
425
|
recaptchaToken,
|
|
425
426
|
callback,
|
|
426
427
|
invitationToken,
|
|
427
428
|
error: e
|
|
428
|
-
});
|
|
429
|
+
}));
|
|
429
430
|
}
|
|
430
431
|
};
|
|
431
432
|
const postLogin = async payload => {
|
|
@@ -1315,13 +1316,10 @@ export default ((store, api, sharedActions) => {
|
|
|
1315
1316
|
return;
|
|
1316
1317
|
}
|
|
1317
1318
|
try {
|
|
1318
|
-
const
|
|
1319
|
-
const body = _extends({
|
|
1319
|
+
const body = {
|
|
1320
1320
|
grant_type: 'refresh_token',
|
|
1321
1321
|
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
1322
|
-
}
|
|
1323
|
-
tenantId: tabTenantId
|
|
1324
|
-
} : {});
|
|
1322
|
+
};
|
|
1325
1323
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
1326
1324
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
1327
1325
|
actions.afterAuthenticationStateUpdate(_extends({}, response, {
|
|
@@ -1376,11 +1374,11 @@ export default ((store, api, sharedActions) => {
|
|
|
1376
1374
|
preserveQueryParams: true
|
|
1377
1375
|
});
|
|
1378
1376
|
} else {
|
|
1379
|
-
var
|
|
1377
|
+
var _ref5;
|
|
1380
1378
|
if (user.id) {
|
|
1381
1379
|
localStorage.setItem('userId', user.id);
|
|
1382
1380
|
}
|
|
1383
|
-
const quickLoginToRegister = (
|
|
1381
|
+
const quickLoginToRegister = (_ref5 = localStorage.getItem('register-quick-login')) != null ? _ref5 : loginState.quickLoginToRegister;
|
|
1384
1382
|
const shouldNavigateToRegisterQuickLogin = __shouldNavigateToRegisterQuickLogin(user);
|
|
1385
1383
|
actions.afterAuthenticationStateUpdate({
|
|
1386
1384
|
user: updatedUser,
|
package/index.js
CHANGED
|
@@ -58,13 +58,10 @@ var _default = (store, api, sharedActions) => {
|
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
62
|
-
const body = (0, _extends2.default)({
|
|
61
|
+
const body = {
|
|
63
62
|
grant_type: 'refresh_token',
|
|
64
63
|
refresh_token: user == null ? void 0 : user.refreshToken
|
|
65
|
-
}
|
|
66
|
-
tenantId: tabTenantId
|
|
67
|
-
} : {});
|
|
64
|
+
};
|
|
68
65
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
69
66
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
70
67
|
actions.afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
|
@@ -416,23 +413,27 @@ var _default = (store, api, sharedActions) => {
|
|
|
416
413
|
}, 2000);
|
|
417
414
|
}
|
|
418
415
|
} else {
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
416
|
+
await ssoPreloginFailed((0, _extends2.default)({}, username ? {
|
|
417
|
+
username
|
|
418
|
+
} : {
|
|
419
|
+
email: email != null ? email : ''
|
|
420
|
+
}, {
|
|
422
421
|
recaptchaToken,
|
|
423
422
|
callback,
|
|
424
423
|
invitationToken
|
|
425
|
-
});
|
|
424
|
+
}));
|
|
426
425
|
}
|
|
427
426
|
} catch (e) {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
427
|
+
await ssoPreloginFailed((0, _extends2.default)({}, username ? {
|
|
428
|
+
username
|
|
429
|
+
} : {
|
|
430
|
+
email: email != null ? email : ''
|
|
431
|
+
}, {
|
|
431
432
|
recaptchaToken,
|
|
432
433
|
callback,
|
|
433
434
|
invitationToken,
|
|
434
435
|
error: e
|
|
435
|
-
});
|
|
436
|
+
}));
|
|
436
437
|
}
|
|
437
438
|
};
|
|
438
439
|
const postLogin = async payload => {
|
|
@@ -1322,13 +1323,10 @@ var _default = (store, api, sharedActions) => {
|
|
|
1322
1323
|
return;
|
|
1323
1324
|
}
|
|
1324
1325
|
try {
|
|
1325
|
-
const
|
|
1326
|
-
const body = (0, _extends2.default)({
|
|
1326
|
+
const body = {
|
|
1327
1327
|
grant_type: 'refresh_token',
|
|
1328
1328
|
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
1329
|
-
}
|
|
1330
|
-
tenantId: tabTenantId
|
|
1331
|
-
} : {});
|
|
1329
|
+
};
|
|
1332
1330
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
1333
1331
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
1334
1332
|
actions.afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
|
@@ -1383,11 +1381,11 @@ var _default = (store, api, sharedActions) => {
|
|
|
1383
1381
|
preserveQueryParams: true
|
|
1384
1382
|
});
|
|
1385
1383
|
} else {
|
|
1386
|
-
var
|
|
1384
|
+
var _ref5;
|
|
1387
1385
|
if (user.id) {
|
|
1388
1386
|
localStorage.setItem('userId', user.id);
|
|
1389
1387
|
}
|
|
1390
|
-
const quickLoginToRegister = (
|
|
1388
|
+
const quickLoginToRegister = (_ref5 = localStorage.getItem('register-quick-login')) != null ? _ref5 : loginState.quickLoginToRegister;
|
|
1391
1389
|
const shouldNavigateToRegisterQuickLogin = __shouldNavigateToRegisterQuickLogin(user);
|
|
1392
1390
|
actions.afterAuthenticationStateUpdate({
|
|
1393
1391
|
user: updatedUser,
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.111.0-alpha.
|
|
3
|
+
"version": "7.111.0-alpha.4",
|
|
4
4
|
"main": "./node/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Frontegg LTD",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/runtime": "^7.18.6",
|
|
9
9
|
"@frontegg/entitlements-javascript-commons": "1.1.2",
|
|
10
|
-
"@frontegg/rest-api": "7.111.0-alpha.
|
|
10
|
+
"@frontegg/rest-api": "7.111.0-alpha.4",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|