@frontegg/redux-store 7.104.0-alpha.1 → 7.105.0-alpha.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.
|
@@ -129,7 +129,8 @@ export default ((store, api, sharedActions) => {
|
|
|
129
129
|
error: undefined,
|
|
130
130
|
userId: response.userId,
|
|
131
131
|
token: response.token,
|
|
132
|
-
step: ForgotPasswordStep.resetPasswordPage
|
|
132
|
+
step: ForgotPasswordStep.resetPasswordPage,
|
|
133
|
+
resetTokenValidationStatus: 'valid'
|
|
133
134
|
});
|
|
134
135
|
} catch (e) {
|
|
135
136
|
setForgotPasswordState({
|
|
@@ -225,7 +226,7 @@ export default ((store, api, sharedActions) => {
|
|
|
225
226
|
}
|
|
226
227
|
};
|
|
227
228
|
const validateResetPasswordToken = async payload => {
|
|
228
|
-
if (payload.skipValidation) {
|
|
229
|
+
if (payload.skipValidation || store.auth.forgotPasswordState.resetTokenValidationStatus === 'valid') {
|
|
229
230
|
var _payload$signal3;
|
|
230
231
|
if (!((_payload$signal3 = payload.signal) != null && _payload$signal3.aborted)) {
|
|
231
232
|
setForgotPasswordState({
|
|
@@ -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, removeTabTenantFromSessionStorage, WebAuthnDeviceType } from '@frontegg/rest-api';
|
|
29
|
+
import { AuthStrategyEnum, ContextHolder, FeatureFlags, getTabTenantFromSessionStorage, 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,10 +51,13 @@ export default ((store, api, sharedActions) => {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
const
|
|
54
|
+
const tabTenantId = getTabTenantFromSessionStorage(store.root.appName);
|
|
55
|
+
const body = _extends({
|
|
55
56
|
grant_type: 'refresh_token',
|
|
56
57
|
refresh_token: user == null ? void 0 : user.refreshToken
|
|
57
|
-
}
|
|
58
|
+
}, tabTenantId && {
|
|
59
|
+
tenantId: tabTenantId
|
|
60
|
+
});
|
|
58
61
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
59
62
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
60
63
|
actions.afterAuthenticationStateUpdate(_extends({}, response, {
|
|
@@ -1312,10 +1315,13 @@ export default ((store, api, sharedActions) => {
|
|
|
1312
1315
|
return;
|
|
1313
1316
|
}
|
|
1314
1317
|
try {
|
|
1315
|
-
const
|
|
1318
|
+
const tabTenantId = getTabTenantFromSessionStorage(store.root.appName);
|
|
1319
|
+
const body = _extends({
|
|
1316
1320
|
grant_type: 'refresh_token',
|
|
1317
1321
|
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
1318
|
-
}
|
|
1322
|
+
}, tabTenantId && {
|
|
1323
|
+
tenantId: tabTenantId
|
|
1324
|
+
});
|
|
1319
1325
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
1320
1326
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
1321
1327
|
actions.afterAuthenticationStateUpdate(_extends({}, response, {
|
package/index.js
CHANGED
|
@@ -136,7 +136,8 @@ var _default = (store, api, sharedActions) => {
|
|
|
136
136
|
error: undefined,
|
|
137
137
|
userId: response.userId,
|
|
138
138
|
token: response.token,
|
|
139
|
-
step: _interfaces.ForgotPasswordStep.resetPasswordPage
|
|
139
|
+
step: _interfaces.ForgotPasswordStep.resetPasswordPage,
|
|
140
|
+
resetTokenValidationStatus: 'valid'
|
|
140
141
|
});
|
|
141
142
|
} catch (e) {
|
|
142
143
|
setForgotPasswordState({
|
|
@@ -232,7 +233,7 @@ var _default = (store, api, sharedActions) => {
|
|
|
232
233
|
}
|
|
233
234
|
};
|
|
234
235
|
const validateResetPasswordToken = async payload => {
|
|
235
|
-
if (payload.skipValidation) {
|
|
236
|
+
if (payload.skipValidation || store.auth.forgotPasswordState.resetTokenValidationStatus === 'valid') {
|
|
236
237
|
var _payload$signal3;
|
|
237
238
|
if (!((_payload$signal3 = payload.signal) != null && _payload$signal3.aborted)) {
|
|
238
239
|
setForgotPasswordState({
|
|
@@ -58,10 +58,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
try {
|
|
61
|
-
const
|
|
61
|
+
const tabTenantId = (0, _restApi.getTabTenantFromSessionStorage)(store.root.appName);
|
|
62
|
+
const body = (0, _extends2.default)({
|
|
62
63
|
grant_type: 'refresh_token',
|
|
63
64
|
refresh_token: user == null ? void 0 : user.refreshToken
|
|
64
|
-
}
|
|
65
|
+
}, tabTenantId && {
|
|
66
|
+
tenantId: tabTenantId
|
|
67
|
+
});
|
|
65
68
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
66
69
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
67
70
|
actions.afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
|
@@ -1319,10 +1322,13 @@ var _default = (store, api, sharedActions) => {
|
|
|
1319
1322
|
return;
|
|
1320
1323
|
}
|
|
1321
1324
|
try {
|
|
1322
|
-
const
|
|
1325
|
+
const tabTenantId = (0, _restApi.getTabTenantFromSessionStorage)(store.root.appName);
|
|
1326
|
+
const body = (0, _extends2.default)({
|
|
1323
1327
|
grant_type: 'refresh_token',
|
|
1324
1328
|
refresh_token: currentUser == null ? void 0 : currentUser.refreshToken
|
|
1325
|
-
}
|
|
1329
|
+
}, tabTenantId && {
|
|
1330
|
+
tenantId: tabTenantId
|
|
1331
|
+
});
|
|
1326
1332
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
1327
1333
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
1328
1334
|
actions.afterAuthenticationStateUpdate((0, _extends2.default)({}, response, {
|
package/node/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/redux-store",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.105.0-alpha.0",
|
|
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.
|
|
10
|
+
"@frontegg/rest-api": "7.105.0-alpha.0",
|
|
11
11
|
"fast-deep-equal": "3.1.3",
|
|
12
12
|
"get-value": "^3.0.1",
|
|
13
13
|
"proxy-compare": "^3.0.0",
|