@frontegg/js 7.114.0 → 7.116.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/index.js +1 -1
- package/node/index.js +1 -1
- package/node/version.js +1 -1
- package/package.json +2 -2
- package/umd/frontegg.development.js +285 -173
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +1 -1
- package/version.js +1 -1
|
@@ -1924,7 +1924,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1924
1924
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1925
1925
|
/* harmony export */ });
|
|
1926
1926
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
1927
|
-
cdnVersion: '7.
|
|
1927
|
+
cdnVersion: '7.116.0'
|
|
1928
1928
|
});
|
|
1929
1929
|
|
|
1930
1930
|
/***/ }),
|
|
@@ -5866,13 +5866,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5866
5866
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
5867
5867
|
/* harmony export */ });
|
|
5868
5868
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
|
|
5869
|
-
/* harmony import */ var
|
|
5870
|
-
/* harmony import */ var
|
|
5871
|
-
/* harmony import */ var
|
|
5872
|
-
/* harmony import */ var
|
|
5873
|
-
/* harmony import */ var
|
|
5869
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/refreshTokenRetry.js");
|
|
5870
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/random.js");
|
|
5871
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
5872
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
|
|
5873
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
5874
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
5874
5875
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/StepUpState/helpers.js");
|
|
5875
|
-
/* harmony import */ var
|
|
5876
|
+
/* harmony import */ var _StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../StepUpState/consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
|
|
5876
5877
|
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
|
|
5877
5878
|
|
|
5878
5879
|
|
|
@@ -5891,8 +5892,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5891
5892
|
var _response;
|
|
5892
5893
|
let response;
|
|
5893
5894
|
if (_toolkit__WEBPACK_IMPORTED_MODULE_1__["default"].isGetTokensAvailable()) {
|
|
5894
|
-
const
|
|
5895
|
-
response = await
|
|
5895
|
+
const authApi = api.auth;
|
|
5896
|
+
response = await (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.refreshTokenWithRetry)(async () => {
|
|
5897
|
+
const tokens = await _toolkit__WEBPACK_IMPORTED_MODULE_1__["default"].getTokens();
|
|
5898
|
+
return await authApi.silentOAuthRefreshTokenV3(tokens);
|
|
5899
|
+
});
|
|
5896
5900
|
} else {
|
|
5897
5901
|
response = await api.auth.silentOAuthRefreshTokenV2();
|
|
5898
5902
|
}
|
|
@@ -5915,7 +5919,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5915
5919
|
context,
|
|
5916
5920
|
urlStrategy
|
|
5917
5921
|
} = store.root;
|
|
5918
|
-
const activeUri = (0,
|
|
5922
|
+
const activeUri = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getUri)(urlStrategy);
|
|
5919
5923
|
if (activeUri === routes.hostedLoginRedirectUrl) {
|
|
5920
5924
|
console.debug('Calling loginWithRedirect while in hostedLoginCallback route');
|
|
5921
5925
|
return;
|
|
@@ -5924,13 +5928,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5924
5928
|
isLoading: true
|
|
5925
5929
|
});
|
|
5926
5930
|
// Generate the relevant params for the redirect
|
|
5927
|
-
const nonce = (0,
|
|
5928
|
-
const code_verifier = (0,
|
|
5929
|
-
const code_challenge = await (0,
|
|
5931
|
+
const nonce = (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.createRandomString)();
|
|
5932
|
+
const code_verifier = (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.createRandomString)();
|
|
5933
|
+
const code_challenge = await (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.generateCodeChallenge)(code_verifier);
|
|
5930
5934
|
|
|
5931
5935
|
// We are saving the verifier in session storage to be able to validate the response
|
|
5932
|
-
localStorage.setItem(
|
|
5933
|
-
const basename = (0,
|
|
5936
|
+
localStorage.setItem(_constants__WEBPACK_IMPORTED_MODULE_5__.HOSTED_LOGIN_VERIFIER_KEY, code_verifier);
|
|
5937
|
+
const basename = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getBaseNameWithoutSlashSuffix)(store);
|
|
5934
5938
|
let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${basename != null ? basename : ''}${routes.hostedLoginRedirectUrl}`;
|
|
5935
5939
|
await actions.loadCustomLoginRoutes();
|
|
5936
5940
|
const customLoginSearchParam = (_store$auth$customLog = store.auth.customLoginState) == null ? void 0 : _store$auth$customLog.customLoginSearchParams;
|
|
@@ -5959,7 +5963,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5959
5963
|
params['organization'] = resolvedTenantResult.tenant;
|
|
5960
5964
|
}
|
|
5961
5965
|
}
|
|
5962
|
-
const tenantId = (0,
|
|
5966
|
+
const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_6__.TENANT_ID_PARAM_KEY);
|
|
5963
5967
|
if (tenantId) {
|
|
5964
5968
|
params['tenantId'] = tenantId;
|
|
5965
5969
|
}
|
|
@@ -5975,7 +5979,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5975
5979
|
const refreshOrRequestHostedLoginAuthorize = async additionalParams => {
|
|
5976
5980
|
var _localStorage;
|
|
5977
5981
|
// when the user pause the step up flow we may still have the key in the local storage in hosted - Remove it
|
|
5978
|
-
(_localStorage = localStorage) == null ? void 0 : _localStorage.removeItem(
|
|
5982
|
+
(_localStorage = localStorage) == null ? void 0 : _localStorage.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__.SHOULD_STEP_UP_KEY);
|
|
5979
5983
|
const disableSilentRefresh = store.auth.disableSilentRefresh;
|
|
5980
5984
|
if ((additionalParams == null ? void 0 : additionalParams['prompt']) === 'login') {
|
|
5981
5985
|
return await requestHostedLoginAuthorize(additionalParams);
|
|
@@ -5990,7 +5994,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5990
5994
|
}
|
|
5991
5995
|
};
|
|
5992
5996
|
const refreshOrRequestHostedLoginAuthorizeV2 = async payload => {
|
|
5993
|
-
var
|
|
5997
|
+
var _additionalParams;
|
|
5994
5998
|
const {
|
|
5995
5999
|
shouldRedirectToLogin,
|
|
5996
6000
|
firstTime,
|
|
@@ -5999,15 +6003,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5999
6003
|
let {
|
|
6000
6004
|
additionalParams
|
|
6001
6005
|
} = payload != null ? payload : {};
|
|
6002
|
-
|
|
6003
|
-
|
|
6006
|
+
const urlDerivedStepUp = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.getUrlDerivedStepUp)();
|
|
6007
|
+
const isNativeStepUp = _toolkit__WEBPACK_IMPORTED_MODULE_1__["default"].isGetTokensAvailable() && urlDerivedStepUp.isStepUpRequested;
|
|
6008
|
+
if (!isNativeStepUp) {
|
|
6009
|
+
var _localStorage2;
|
|
6010
|
+
(_localStorage2 = localStorage) == null ? void 0 : _localStorage2.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__.SHOULD_STEP_UP_KEY);
|
|
6011
|
+
}
|
|
6004
6012
|
if (firstTime) {
|
|
6005
6013
|
const urlStrategy = store.root.urlStrategy;
|
|
6006
|
-
const activeUri = (0,
|
|
6014
|
+
const activeUri = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.getUri)(urlStrategy);
|
|
6007
6015
|
actions.setAuthState({
|
|
6008
6016
|
isLoading: true
|
|
6009
6017
|
});
|
|
6010
|
-
if ((0,
|
|
6018
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_6__.isOauthCallbackRoute)(activeUri)) {
|
|
6011
6019
|
return;
|
|
6012
6020
|
}
|
|
6013
6021
|
}
|
|
@@ -6022,6 +6030,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6022
6030
|
if (((_additionalParams = additionalParams) == null ? void 0 : _additionalParams['prompt']) === 'login') {
|
|
6023
6031
|
return await requestHostedLoginAuthorize(additionalParams);
|
|
6024
6032
|
}
|
|
6033
|
+
if (isNativeStepUp && !(0,_helpers__WEBPACK_IMPORTED_MODULE_8__.isSteppedUp)(store.auth.user, {
|
|
6034
|
+
maxAge: urlDerivedStepUp.maxAge
|
|
6035
|
+
})) {
|
|
6036
|
+
const {
|
|
6037
|
+
routes,
|
|
6038
|
+
onRedirectTo
|
|
6039
|
+
} = store.auth;
|
|
6040
|
+
if (routes.stepUpUrl && !window.location.href.includes(routes.stepUpUrl)) {
|
|
6041
|
+
window.localStorage.setItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__.SHOULD_STEP_UP_KEY, 'true');
|
|
6042
|
+
actions.setAuthState({
|
|
6043
|
+
isLoading: true
|
|
6044
|
+
});
|
|
6045
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_8__.redirectByStepUpUrl)(routes.stepUpUrl, onRedirectTo, urlDerivedStepUp.maxAge);
|
|
6046
|
+
return;
|
|
6047
|
+
}
|
|
6048
|
+
}
|
|
6025
6049
|
try {
|
|
6026
6050
|
if (disableSilentRefresh) {
|
|
6027
6051
|
throw new Error('silent refresh is disabled');
|
|
@@ -6040,10 +6064,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6040
6064
|
const handleHostedLoginCallback = async payload => {
|
|
6041
6065
|
var _store$auth$customLog2;
|
|
6042
6066
|
// Hard coded for now
|
|
6043
|
-
const code_verifier = localStorage.getItem(
|
|
6067
|
+
const code_verifier = localStorage.getItem(_constants__WEBPACK_IMPORTED_MODULE_5__.HOSTED_LOGIN_VERIFIER_KEY) || 'INVALID-CODE-VERIFIER';
|
|
6044
6068
|
const routes = store.auth.routes;
|
|
6045
6069
|
const urlStrategy = store.root.urlStrategy;
|
|
6046
|
-
const basename = (0,
|
|
6070
|
+
const basename = (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getBaseNameWithoutSlashSuffix)(store);
|
|
6047
6071
|
let redirectUrl = `${window.location.origin}${urlStrategy === 'path' ? '' : '#'}${basename != null ? basename : ''}${routes.hostedLoginRedirectUrl}`;
|
|
6048
6072
|
await actions.loadCustomLoginRoutes();
|
|
6049
6073
|
const customLoginSearchParam = (_store$auth$customLog2 = store.auth.customLoginState) == null ? void 0 : _store$auth$customLog2.customLoginSearchParams;
|
|
@@ -6059,7 +6083,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6059
6083
|
code_verifier,
|
|
6060
6084
|
grant_type: 'authorization_code'
|
|
6061
6085
|
};
|
|
6062
|
-
const isStepUpFlow = window.localStorage.getItem(
|
|
6086
|
+
const isStepUpFlow = window.localStorage.getItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__.SHOULD_STEP_UP_KEY);
|
|
6063
6087
|
try {
|
|
6064
6088
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
6065
6089
|
const user = response.user;
|
|
@@ -6076,7 +6100,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6076
6100
|
email: user == null ? void 0 : user.email,
|
|
6077
6101
|
name: user == null ? void 0 : user.name
|
|
6078
6102
|
};
|
|
6079
|
-
(0,
|
|
6103
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_9__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_9__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6080
6104
|
}
|
|
6081
6105
|
} catch (e) {
|
|
6082
6106
|
actions.setAuthState({
|
|
@@ -6085,7 +6109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6085
6109
|
console.error('Failed to exchangeOAuthTokens', e);
|
|
6086
6110
|
} finally {
|
|
6087
6111
|
const user = store.auth.user;
|
|
6088
|
-
window.localStorage.removeItem(
|
|
6112
|
+
window.localStorage.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_7__.SHOULD_STEP_UP_KEY);
|
|
6089
6113
|
|
|
6090
6114
|
// when the user pause the step up flow we may still have the key in the local storage in hosted. Ignore it.
|
|
6091
6115
|
if (isStepUpFlow && (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.isSteppedUp)(user)) {
|
|
@@ -6119,37 +6143,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6119
6143
|
/* harmony export */ });
|
|
6120
6144
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
|
|
6121
6145
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
|
|
6122
|
-
/* harmony import */ var
|
|
6123
|
-
/* harmony import */ var
|
|
6124
|
-
/* harmony import */ var
|
|
6125
|
-
/* harmony import */ var
|
|
6126
|
-
/* harmony import */ var
|
|
6127
|
-
/* harmony import */ var
|
|
6128
|
-
/* harmony import */ var
|
|
6129
|
-
/* harmony import */ var
|
|
6130
|
-
/* harmony import */ var
|
|
6131
|
-
/* harmony import */ var
|
|
6132
|
-
/* harmony import */ var
|
|
6133
|
-
/* harmony import */ var
|
|
6134
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/
|
|
6135
|
-
/* harmony import */ var
|
|
6136
|
-
/* harmony import */ var
|
|
6146
|
+
/* harmony import */ var _afterAuthNavigation_actions__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./afterAuthNavigation.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/afterAuthNavigation.actions.js");
|
|
6147
|
+
/* harmony import */ var _handleVerifyMFAResponse_actions__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./handleVerifyMFAResponse.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/handleVerifyMFAResponse.actions.js");
|
|
6148
|
+
/* harmony import */ var _mfaRequiredState_actions__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./mfaRequiredState.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaRequiredState.actions.js");
|
|
6149
|
+
/* harmony import */ var _mfaWithAuthenticator_actions__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./mfaWithAuthenticator.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithAuthenticator.actions.js");
|
|
6150
|
+
/* harmony import */ var _mfaWithEmailCode_actions__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./mfaWithEmailCode.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithEmailCode.actions.js");
|
|
6151
|
+
/* harmony import */ var _mfaWithSMS_actions__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./mfaWithSMS.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithSMS.actions.js");
|
|
6152
|
+
/* harmony import */ var _mfaWithWebAuthn_actions__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./mfaWithWebAuthn.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/mfaWithWebAuthn.actions.js");
|
|
6153
|
+
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
|
|
6154
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/refreshTokenRetry.js");
|
|
6155
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
6156
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
|
|
6157
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
6158
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
|
|
6159
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
|
|
6160
|
+
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
|
|
6161
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
6137
6162
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/ContextHolder/index.js");
|
|
6138
6163
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
|
|
6139
|
-
/* harmony import */ var
|
|
6140
|
-
/* harmony import */ var
|
|
6141
|
-
/* harmony import */ var
|
|
6142
|
-
/* harmony import */ var
|
|
6143
|
-
/* harmony import */ var
|
|
6144
|
-
/* harmony import */ var
|
|
6145
|
-
/* harmony import */ var
|
|
6146
|
-
/* harmony import */ var
|
|
6147
|
-
/* harmony import */ var
|
|
6148
|
-
/* harmony import */ var
|
|
6149
|
-
/* harmony import */ var
|
|
6150
|
-
/* harmony import */ var
|
|
6151
|
-
/* harmony import */ var
|
|
6152
|
-
/* harmony import */ var
|
|
6164
|
+
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
|
|
6165
|
+
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
|
|
6166
|
+
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/interfaces.js");
|
|
6167
|
+
/* harmony import */ var _hostedLoginAuthorize_actions__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./hostedLoginAuthorize.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/hostedLoginAuthorize.actions.js");
|
|
6168
|
+
/* harmony import */ var _oauthStorage__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../oauthStorage */ "../../dist/@frontegg/redux-store/auth/LoginState/oauthStorage.js");
|
|
6169
|
+
/* harmony import */ var _StepUpState_consts__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../StepUpState/consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
|
|
6170
|
+
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
|
|
6171
|
+
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
|
|
6172
|
+
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
|
|
6173
|
+
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
|
|
6174
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
6175
|
+
/* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
|
|
6176
|
+
/* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
|
|
6177
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
|
|
6153
6178
|
|
|
6154
6179
|
|
|
6155
6180
|
const _excluded = ["callback", "error"],
|
|
@@ -6192,6 +6217,7 @@ const _excluded = ["callback", "error"],
|
|
|
6192
6217
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((store, api, sharedActions) => {
|
|
6193
6218
|
const actions = sharedActions;
|
|
6194
6219
|
const contextHolder = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.ContextHolder.for(store.root.appName);
|
|
6220
|
+
|
|
6195
6221
|
/** @private */
|
|
6196
6222
|
const __refreshTokenHosted = async () => {
|
|
6197
6223
|
const user = store.auth.user;
|
|
@@ -6250,8 +6276,8 @@ const _excluded = ["callback", "error"],
|
|
|
6250
6276
|
user,
|
|
6251
6277
|
tenants = [],
|
|
6252
6278
|
activeTenant
|
|
6253
|
-
} = await api.auth.refreshTokenV3();
|
|
6254
|
-
if ((0,
|
|
6279
|
+
} = await (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.refreshTokenWithRetry)(() => api.auth.refreshTokenV3());
|
|
6280
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
6255
6281
|
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
6256
6282
|
actions.setAuthState(mfaRequiredState);
|
|
6257
6283
|
onRedirectTo(routes.loginUrl, {
|
|
@@ -6272,7 +6298,7 @@ const _excluded = ["callback", "error"],
|
|
|
6272
6298
|
}, {
|
|
6273
6299
|
loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
|
|
6274
6300
|
quickLoginToRegister,
|
|
6275
|
-
flow: shouldNavigateToRegisterQuickLogin ?
|
|
6301
|
+
flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.Login
|
|
6276
6302
|
}),
|
|
6277
6303
|
isAuthenticated: true
|
|
6278
6304
|
});
|
|
@@ -6293,8 +6319,11 @@ const _excluded = ["callback", "error"],
|
|
|
6293
6319
|
/** @private */
|
|
6294
6320
|
const __refreshTokenWithNativeTokens = async () => {
|
|
6295
6321
|
try {
|
|
6296
|
-
const
|
|
6297
|
-
const response = await
|
|
6322
|
+
const authApi = api.auth;
|
|
6323
|
+
const response = await (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.refreshTokenWithRetry)(async () => {
|
|
6324
|
+
const tokens = await _toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].getTokens();
|
|
6325
|
+
return await authApi.silentOAuthRefreshTokenV3(tokens);
|
|
6326
|
+
});
|
|
6298
6327
|
const updatedUser = await __handleUnnecessaryEntitlementsUpdate(response.user);
|
|
6299
6328
|
actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, response, {
|
|
6300
6329
|
user: updatedUser
|
|
@@ -6313,7 +6342,7 @@ const _excluded = ["callback", "error"],
|
|
|
6313
6342
|
|
|
6314
6343
|
/** @protected */
|
|
6315
6344
|
const __refreshToken = async () => {
|
|
6316
|
-
if (
|
|
6345
|
+
if (_toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].isGetTokensAvailable()) {
|
|
6317
6346
|
await __refreshTokenWithNativeTokens();
|
|
6318
6347
|
return;
|
|
6319
6348
|
}
|
|
@@ -6338,7 +6367,7 @@ const _excluded = ["callback", "error"],
|
|
|
6338
6367
|
var _store$auth$user;
|
|
6339
6368
|
// @ts-ignore TODO: fix entitlements state type
|
|
6340
6369
|
const oldEntitlements = (_store$auth$user = store.auth.user) == null ? void 0 : _store$auth$user.entitlements;
|
|
6341
|
-
if ((0,
|
|
6370
|
+
if ((0,_toolkit__WEBPACK_IMPORTED_MODULE_8__.isEntitlementsDeeplyEqual)(oldEntitlements, updatedUser == null ? void 0 : updatedUser.entitlements)) {
|
|
6342
6371
|
// set the previous entitlements object
|
|
6343
6372
|
return (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, updatedUser, {
|
|
6344
6373
|
entitlements: oldEntitlements
|
|
@@ -6358,7 +6387,7 @@ const _excluded = ["callback", "error"],
|
|
|
6358
6387
|
loginState,
|
|
6359
6388
|
onRedirectTo
|
|
6360
6389
|
} = store.auth;
|
|
6361
|
-
const [preventAuthRedirectOnSocialLogin] =
|
|
6390
|
+
const [preventAuthRedirectOnSocialLogin] = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_9__.FeatureFlags.getFeatureFlags(['prevent-auth-redirect-on-social-login'], store.root.appName);
|
|
6362
6391
|
const invitationToken = url.searchParams.get('invitationToken');
|
|
6363
6392
|
const redirectRoutes = [routes.socialLoginCallbackUrl, routes.oidcRedirectUrl, routes.samlCallbackUrl, routes.magicLinkCallbackUrl];
|
|
6364
6393
|
if (!invitationToken) {
|
|
@@ -6387,7 +6416,7 @@ const _excluded = ["callback", "error"],
|
|
|
6387
6416
|
var _payload$callback;
|
|
6388
6417
|
const {
|
|
6389
6418
|
isActive
|
|
6390
|
-
} = await (0,
|
|
6419
|
+
} = await (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.retryIfNeeded)(api.auth.getSSOPublicConfiguration, payload == null ? void 0 : payload.retryConfig);
|
|
6391
6420
|
actions.setAuthState({
|
|
6392
6421
|
isSSOAuth: isActive
|
|
6393
6422
|
});
|
|
@@ -6406,7 +6435,7 @@ const _excluded = ["callback", "error"],
|
|
|
6406
6435
|
let ssoACS;
|
|
6407
6436
|
try {
|
|
6408
6437
|
var _metadata$configurati;
|
|
6409
|
-
const metadata = await (0,
|
|
6438
|
+
const metadata = await (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.retryIfNeeded)(api.metadata.getSamlMetadata, payload == null ? void 0 : payload.retryConfig);
|
|
6410
6439
|
ssoACS = metadata == null ? void 0 : (_metadata$configurati = metadata.configuration) == null ? void 0 : _metadata$configurati.acsUrl;
|
|
6411
6440
|
} catch (e) {
|
|
6412
6441
|
console.error(e);
|
|
@@ -6432,8 +6461,8 @@ const _excluded = ["callback", "error"],
|
|
|
6432
6461
|
onRedirectTo,
|
|
6433
6462
|
routes
|
|
6434
6463
|
} = store.auth;
|
|
6435
|
-
if ((0,
|
|
6436
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user,
|
|
6464
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
6465
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_11__.DEFAULT_RETRY_CONFIG, true);
|
|
6437
6466
|
actions.setAuthState(mfaRequiredState);
|
|
6438
6467
|
onRedirectTo(routes.loginUrl, {
|
|
6439
6468
|
preserveQueryParams: true
|
|
@@ -6444,17 +6473,17 @@ const _excluded = ["callback", "error"],
|
|
|
6444
6473
|
Object.assign(store.auth.loginState, state);
|
|
6445
6474
|
};
|
|
6446
6475
|
const resetLoginState = () => {
|
|
6447
|
-
(0,
|
|
6476
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_10__.deepResetState)(store, ['auth', 'loginState'], _state__WEBPACK_IMPORTED_MODULE_12__.initialState);
|
|
6448
6477
|
};
|
|
6449
6478
|
const getRetryWithBlockingCallbackPayload = requestName => {
|
|
6450
6479
|
const callback = (_, error) => {
|
|
6451
6480
|
if (!error || error.statusCode < 500) return;
|
|
6452
6481
|
actions.setErrorByRequestName({
|
|
6453
6482
|
requestName,
|
|
6454
|
-
traceId: (0,
|
|
6483
|
+
traceId: (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.errorTraceId)(error)
|
|
6455
6484
|
});
|
|
6456
6485
|
};
|
|
6457
|
-
return (0,
|
|
6486
|
+
return (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)({
|
|
6458
6487
|
callback
|
|
6459
6488
|
});
|
|
6460
6489
|
};
|
|
@@ -6466,19 +6495,19 @@ const _excluded = ["callback", "error"],
|
|
|
6466
6495
|
actions.setAuthState({
|
|
6467
6496
|
isLoading: true
|
|
6468
6497
|
});
|
|
6469
|
-
calls.push(actions.loadSocialLoginsConfigurationV2((0,
|
|
6470
|
-
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(
|
|
6471
|
-
calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(
|
|
6498
|
+
calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)()));
|
|
6499
|
+
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
|
|
6500
|
+
calls.push(actions.loadPublicAuthStrategiesPolicy(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_PUBLIC_AUTH_STRATEGIES_POLICY)));
|
|
6472
6501
|
calls.push(actions.loadSignUpStrategies());
|
|
6473
|
-
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(
|
|
6474
|
-
calls.push(actions.loadVendorPublicInfo((0,
|
|
6475
|
-
calls.push(__refreshMetadata((0,
|
|
6502
|
+
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
|
|
6503
|
+
calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)()));
|
|
6504
|
+
calls.push(__refreshMetadata((0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)()));
|
|
6476
6505
|
/*
|
|
6477
6506
|
We will load custom login routes only if custom login is enabled
|
|
6478
6507
|
to check if custom login is enabled without the tenant alias (search-param/subdomain)
|
|
6479
6508
|
we have to wait for the user state (refreshToken request)
|
|
6480
6509
|
*/
|
|
6481
|
-
callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(
|
|
6510
|
+
callsAfterRefresh.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
|
|
6482
6511
|
}
|
|
6483
6512
|
await Promise.all(calls);
|
|
6484
6513
|
if (callsAfterRefresh.length > 0) {
|
|
@@ -6490,14 +6519,14 @@ const _excluded = ["callback", "error"],
|
|
|
6490
6519
|
};
|
|
6491
6520
|
const requestAuthorizeSSR = async payload => {
|
|
6492
6521
|
const calls = [];
|
|
6493
|
-
calls.push(actions.loadSocialLoginsConfigurationV2((0,
|
|
6494
|
-
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(
|
|
6495
|
-
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(
|
|
6522
|
+
calls.push(actions.loadSocialLoginsConfigurationV2((0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)()));
|
|
6523
|
+
calls.push(actions.loadAllowSignUps(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_ALLOW_SIGNUPS)));
|
|
6524
|
+
calls.push(__loadSSOPublicConfigurationFunction(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_SSO_PUBLIC_CONFIGURATION)));
|
|
6496
6525
|
calls.push(actions.loadSignUpStrategies());
|
|
6497
|
-
calls.push(actions.loadVendorPublicInfo((0,
|
|
6526
|
+
calls.push(actions.loadVendorPublicInfo((0,_helpers__WEBPACK_IMPORTED_MODULE_10__.withRetryConfig)()));
|
|
6498
6527
|
calls.push(__refreshMetadata());
|
|
6499
6528
|
calls.push(__isMFARequiredSSR(payload));
|
|
6500
|
-
calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(
|
|
6529
|
+
calls.push(actions.loadCustomLoginRoutes(getRetryWithBlockingCallbackPayload(_interfaces__WEBPACK_IMPORTED_MODULE_13__.REQUEST_NAME.LOAD_CUSTOM_LOGIN_ROUTES)));
|
|
6501
6530
|
await Promise.all(calls);
|
|
6502
6531
|
};
|
|
6503
6532
|
const ssoPreloginFailed = async _ref3 => {
|
|
@@ -6509,28 +6538,28 @@ const _excluded = ["callback", "error"],
|
|
|
6509
6538
|
const publicPolicy = store.auth.securityPolicyState.publicPolicy.policy;
|
|
6510
6539
|
if (!(publicPolicy != null && publicPolicy.authStrategy)) {
|
|
6511
6540
|
actions.setLoginState({
|
|
6512
|
-
step:
|
|
6541
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithPassword,
|
|
6513
6542
|
loading: false
|
|
6514
6543
|
});
|
|
6515
6544
|
callback == null ? void 0 : callback();
|
|
6516
6545
|
return;
|
|
6517
6546
|
}
|
|
6518
|
-
if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) ===
|
|
6547
|
+
if ((publicPolicy == null ? void 0 : publicPolicy.authStrategy) === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.EmailAndPassword) {
|
|
6519
6548
|
actions.setLoginState({
|
|
6520
|
-
step:
|
|
6549
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithPassword,
|
|
6521
6550
|
loading: false
|
|
6522
6551
|
});
|
|
6523
6552
|
callback == null ? void 0 : callback();
|
|
6524
|
-
} else if ([
|
|
6553
|
+
} else if ([_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.MagicLink, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.Code, _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.SmsCode].includes(publicPolicy == null ? void 0 : publicPolicy.authStrategy)) {
|
|
6525
6554
|
await actions.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, body, {
|
|
6526
6555
|
type: publicPolicy == null ? void 0 : publicPolicy.authStrategy,
|
|
6527
6556
|
callback
|
|
6528
6557
|
}));
|
|
6529
6558
|
} else {
|
|
6530
6559
|
actions.setLoginState({
|
|
6531
|
-
step:
|
|
6560
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithPassword,
|
|
6532
6561
|
loading: false,
|
|
6533
|
-
error: (0,
|
|
6562
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(error)
|
|
6534
6563
|
});
|
|
6535
6564
|
callback == null ? void 0 : callback();
|
|
6536
6565
|
}
|
|
@@ -6548,7 +6577,7 @@ const _excluded = ["callback", "error"],
|
|
|
6548
6577
|
});
|
|
6549
6578
|
try {
|
|
6550
6579
|
const onRedirectTo = store.auth.onRedirectTo;
|
|
6551
|
-
const tenantId = (0,
|
|
6580
|
+
const tenantId = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.getSearchParam)(_helpers__WEBPACK_IMPORTED_MODULE_16__.TENANT_ID_PARAM_KEY);
|
|
6552
6581
|
const preLoginResult = await api.auth.preLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, email ? {
|
|
6553
6582
|
email
|
|
6554
6583
|
} : {}, username ? {
|
|
@@ -6562,22 +6591,22 @@ const _excluded = ["callback", "error"],
|
|
|
6562
6591
|
} = preLoginResult != null ? preLoginResult : {};
|
|
6563
6592
|
if (address) {
|
|
6564
6593
|
let ssoRedirectUrl = address;
|
|
6565
|
-
if (idpType ===
|
|
6594
|
+
if (idpType === _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_17__.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
|
|
6566
6595
|
const {
|
|
6567
6596
|
oidcRedirectUrl
|
|
6568
6597
|
} = store.auth.routes;
|
|
6569
6598
|
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
6570
6599
|
}
|
|
6571
|
-
if (
|
|
6600
|
+
if (_toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].isLoginWithSSOAvailable()) {
|
|
6572
6601
|
var _ref4;
|
|
6573
|
-
|
|
6602
|
+
_toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].loginWithSSO((_ref4 = email != null ? email : username) != null ? _ref4 : '');
|
|
6574
6603
|
setLoginState({
|
|
6575
6604
|
loading: false
|
|
6576
6605
|
});
|
|
6577
6606
|
callback == null ? void 0 : callback();
|
|
6578
6607
|
} else {
|
|
6579
6608
|
setLoginState({
|
|
6580
|
-
step:
|
|
6609
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.redirectToSSO,
|
|
6581
6610
|
loading: false,
|
|
6582
6611
|
ssoRedirectUrl
|
|
6583
6612
|
});
|
|
@@ -6636,7 +6665,7 @@ const _excluded = ["callback", "error"],
|
|
|
6636
6665
|
email: user.email,
|
|
6637
6666
|
name: user.name
|
|
6638
6667
|
};
|
|
6639
|
-
(0,
|
|
6668
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_18__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_18__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6640
6669
|
}
|
|
6641
6670
|
await actions.afterAuthNavigation();
|
|
6642
6671
|
} catch (e) {
|
|
@@ -6644,7 +6673,7 @@ const _excluded = ["callback", "error"],
|
|
|
6644
6673
|
onRedirectTo(routes.authenticatedUrl);
|
|
6645
6674
|
}, 1000);
|
|
6646
6675
|
setLoginState({
|
|
6647
|
-
step:
|
|
6676
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithSSOFailed,
|
|
6648
6677
|
loading: false
|
|
6649
6678
|
});
|
|
6650
6679
|
}
|
|
@@ -6679,17 +6708,17 @@ const _excluded = ["callback", "error"],
|
|
|
6679
6708
|
onRedirectTo,
|
|
6680
6709
|
routes
|
|
6681
6710
|
} = store.auth;
|
|
6682
|
-
if ((0,
|
|
6683
|
-
const mfaRequiredState = await actions.getMfaRequiredState(user,
|
|
6711
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
6712
|
+
const mfaRequiredState = await actions.getMfaRequiredState(user, _constants__WEBPACK_IMPORTED_MODULE_11__.DEFAULT_RETRY_CONFIG, true, email);
|
|
6684
6713
|
actions.setAuthState(mfaRequiredState);
|
|
6685
6714
|
onRedirectTo(routes.loginUrl, {
|
|
6686
6715
|
preserveQueryParams: true
|
|
6687
6716
|
});
|
|
6688
6717
|
} else {
|
|
6689
6718
|
const [securityCenterLoginFlows] = await actions.getFeatureFlags(['security-center-show-login-flows']);
|
|
6690
|
-
if ((0,
|
|
6719
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isResetPasswordRequired)(user, store.root.appName)) {
|
|
6691
6720
|
setLoginState({
|
|
6692
|
-
step:
|
|
6721
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.passwordRotationExpired,
|
|
6693
6722
|
loading: false,
|
|
6694
6723
|
resetPasswordToken: user.resetPasswordToken,
|
|
6695
6724
|
userId: user.userId
|
|
@@ -6712,7 +6741,7 @@ const _excluded = ["callback", "error"],
|
|
|
6712
6741
|
loading: false,
|
|
6713
6742
|
error: undefined,
|
|
6714
6743
|
mfaToken: user.mfaToken,
|
|
6715
|
-
step: loginState.flow ===
|
|
6744
|
+
step: loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.Login ? _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.success : loginState.step,
|
|
6716
6745
|
tenants,
|
|
6717
6746
|
tenantsLoading: true,
|
|
6718
6747
|
isBreachedPassword: user.isBreachedPassword
|
|
@@ -6729,27 +6758,27 @@ const _excluded = ["callback", "error"],
|
|
|
6729
6758
|
email,
|
|
6730
6759
|
name: user.name
|
|
6731
6760
|
};
|
|
6732
|
-
(0,
|
|
6761
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_18__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_18__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6733
6762
|
}
|
|
6734
|
-
if (loginState.flow ===
|
|
6763
|
+
if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.Login) {
|
|
6735
6764
|
if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
|
|
6736
6765
|
setLoginState({
|
|
6737
|
-
step:
|
|
6766
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.breachedPassword,
|
|
6738
6767
|
loading: false
|
|
6739
6768
|
});
|
|
6740
6769
|
} else {
|
|
6741
6770
|
if (isAuthenticated) {
|
|
6742
|
-
const shouldShowPasswordRotationPrompt = (0,
|
|
6771
|
+
const shouldShowPasswordRotationPrompt = (0,_helpers__WEBPACK_IMPORTED_MODULE_16__.shouldShowPasswordRotationPromptFunc)(user);
|
|
6743
6772
|
if (shouldShowPasswordRotationPrompt) {
|
|
6744
6773
|
setLoginState({
|
|
6745
|
-
step:
|
|
6774
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.passwordRotationNotification,
|
|
6746
6775
|
loading: false
|
|
6747
6776
|
});
|
|
6748
6777
|
} else {
|
|
6749
6778
|
const shouldShowPromptPasskeys = await actions.__shouldShowPromptPasskeys();
|
|
6750
6779
|
if (shouldShowPromptPasskeys) {
|
|
6751
6780
|
setLoginState({
|
|
6752
|
-
step:
|
|
6781
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.promptPasskeys,
|
|
6753
6782
|
loading: false
|
|
6754
6783
|
});
|
|
6755
6784
|
onRedirectTo(routes.loginUrl, {
|
|
@@ -6764,8 +6793,8 @@ const _excluded = ["callback", "error"],
|
|
|
6764
6793
|
}
|
|
6765
6794
|
}
|
|
6766
6795
|
}
|
|
6767
|
-
if (
|
|
6768
|
-
|
|
6796
|
+
if (_toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].isSuggestSavePasswordAvailable()) {
|
|
6797
|
+
_toolkit__WEBPACK_IMPORTED_MODULE_7__["default"].suggestSavePassword(email, password);
|
|
6769
6798
|
}
|
|
6770
6799
|
|
|
6771
6800
|
// TODO: extract item name to constants
|
|
@@ -6777,7 +6806,7 @@ const _excluded = ["callback", "error"],
|
|
|
6777
6806
|
callback == null ? void 0 : callback(false, e);
|
|
6778
6807
|
setLoginState({
|
|
6779
6808
|
email,
|
|
6780
|
-
error: (0,
|
|
6809
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6781
6810
|
loading: false
|
|
6782
6811
|
});
|
|
6783
6812
|
}
|
|
@@ -6790,7 +6819,7 @@ const _excluded = ["callback", "error"],
|
|
|
6790
6819
|
}
|
|
6791
6820
|
// Step-up re-login goes through silentLogout but still needs the hosted OAuth state to finish the client flow.
|
|
6792
6821
|
if (!keepHostedOAuthState) {
|
|
6793
|
-
(0,
|
|
6822
|
+
(0,_oauthStorage__WEBPACK_IMPORTED_MODULE_19__.clearHostedOAuthState)();
|
|
6794
6823
|
}
|
|
6795
6824
|
};
|
|
6796
6825
|
const logout = async payload => {
|
|
@@ -6819,7 +6848,7 @@ const _excluded = ["callback", "error"],
|
|
|
6819
6848
|
} catch {
|
|
6820
6849
|
/* empty */
|
|
6821
6850
|
}
|
|
6822
|
-
const isStepUpInProgress = !!((_window2 = window) != null && _window2.localStorage.getItem(
|
|
6851
|
+
const isStepUpInProgress = !!((_window2 = window) != null && _window2.localStorage.getItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_20__.SHOULD_STEP_UP_KEY));
|
|
6823
6852
|
clearLogoutLocalState({
|
|
6824
6853
|
keepHostedOAuthState: isStepUpInProgress
|
|
6825
6854
|
});
|
|
@@ -6838,7 +6867,7 @@ const _excluded = ["callback", "error"],
|
|
|
6838
6867
|
setLoginState({
|
|
6839
6868
|
loading: false,
|
|
6840
6869
|
error: undefined,
|
|
6841
|
-
step:
|
|
6870
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.preLogin
|
|
6842
6871
|
});
|
|
6843
6872
|
actions.setAuthState({
|
|
6844
6873
|
user: undefined,
|
|
@@ -6848,7 +6877,7 @@ const _excluded = ["callback", "error"],
|
|
|
6848
6877
|
} catch (e) {
|
|
6849
6878
|
var _payload$callback5;
|
|
6850
6879
|
setLoginState({
|
|
6851
|
-
error: (0,
|
|
6880
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6852
6881
|
loading: false
|
|
6853
6882
|
});
|
|
6854
6883
|
(_payload$callback5 = payload.callback) == null ? void 0 : _payload$callback5.call(payload, false, e);
|
|
@@ -6867,10 +6896,10 @@ const _excluded = ["callback", "error"],
|
|
|
6867
6896
|
// TODO: fix @frontegg/rest-api return value
|
|
6868
6897
|
// @ts-ignore
|
|
6869
6898
|
const preloginRes = await api.auth.passwordlessPreLogin((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, payload, {
|
|
6870
|
-
type:
|
|
6899
|
+
type: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.SmsCode
|
|
6871
6900
|
}));
|
|
6872
6901
|
setLoginState({
|
|
6873
|
-
step:
|
|
6902
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithQuickSmsOtc,
|
|
6874
6903
|
loading: false,
|
|
6875
6904
|
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
6876
6905
|
error: undefined
|
|
@@ -6878,7 +6907,7 @@ const _excluded = ["callback", "error"],
|
|
|
6878
6907
|
callback == null ? void 0 : callback(true);
|
|
6879
6908
|
} catch (e) {
|
|
6880
6909
|
setLoginState({
|
|
6881
|
-
error: (0,
|
|
6910
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6882
6911
|
loading: false
|
|
6883
6912
|
});
|
|
6884
6913
|
callback == null ? void 0 : callback(false, e);
|
|
@@ -6898,13 +6927,13 @@ const _excluded = ["callback", "error"],
|
|
|
6898
6927
|
phoneNumber: payload.phoneNumber,
|
|
6899
6928
|
loading: false,
|
|
6900
6929
|
changePhoneId: changePhoneRes.changePhoneId,
|
|
6901
|
-
step:
|
|
6930
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.loginWithQuickSmsOtc,
|
|
6902
6931
|
error: undefined
|
|
6903
6932
|
});
|
|
6904
6933
|
callback == null ? void 0 : callback(true);
|
|
6905
6934
|
} catch (e) {
|
|
6906
6935
|
setLoginState({
|
|
6907
|
-
error: (0,
|
|
6936
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6908
6937
|
loading: false
|
|
6909
6938
|
});
|
|
6910
6939
|
}
|
|
@@ -6925,7 +6954,7 @@ const _excluded = ["callback", "error"],
|
|
|
6925
6954
|
callback == null ? void 0 : callback(true);
|
|
6926
6955
|
} catch (e) {
|
|
6927
6956
|
setLoginState({
|
|
6928
|
-
error: (0,
|
|
6957
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6929
6958
|
loading: false
|
|
6930
6959
|
});
|
|
6931
6960
|
}
|
|
@@ -6941,11 +6970,11 @@ const _excluded = ["callback", "error"],
|
|
|
6941
6970
|
loading: true
|
|
6942
6971
|
});
|
|
6943
6972
|
let email;
|
|
6944
|
-
if ((0,
|
|
6973
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_16__.isEmailPayload)(payload)) {
|
|
6945
6974
|
email = payload.email;
|
|
6946
6975
|
}
|
|
6947
6976
|
let username;
|
|
6948
|
-
if ((0,
|
|
6977
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_16__.isUsernamePayload)(payload)) {
|
|
6949
6978
|
username = payload.username;
|
|
6950
6979
|
}
|
|
6951
6980
|
// TODO: [Typescript 4.8] fix @frontegg/rest-api return value
|
|
@@ -6955,7 +6984,7 @@ const _excluded = ["callback", "error"],
|
|
|
6955
6984
|
username: (_username = username) != null ? _username : ''
|
|
6956
6985
|
}));
|
|
6957
6986
|
// @ts-ignore
|
|
6958
|
-
const step =
|
|
6987
|
+
const step = _consts__WEBPACK_IMPORTED_MODULE_21__.authStrategyLoginStepMap[payload.type];
|
|
6959
6988
|
setLoginState({
|
|
6960
6989
|
step,
|
|
6961
6990
|
loading: false,
|
|
@@ -6967,7 +6996,7 @@ const _excluded = ["callback", "error"],
|
|
|
6967
6996
|
callback == null ? void 0 : callback();
|
|
6968
6997
|
} catch (e) {
|
|
6969
6998
|
setLoginState({
|
|
6970
|
-
error: (0,
|
|
6999
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e),
|
|
6971
7000
|
loading: false
|
|
6972
7001
|
});
|
|
6973
7002
|
callback == null ? void 0 : callback(null, e);
|
|
@@ -6992,7 +7021,7 @@ const _excluded = ["callback", "error"],
|
|
|
6992
7021
|
routes,
|
|
6993
7022
|
onRedirectTo
|
|
6994
7023
|
} = store.auth;
|
|
6995
|
-
if ((0,
|
|
7024
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
6996
7025
|
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
6997
7026
|
actions.setAuthState(mfaRequiredState);
|
|
6998
7027
|
onRedirectTo(routes.loginUrl, {
|
|
@@ -7005,14 +7034,14 @@ const _excluded = ["callback", "error"],
|
|
|
7005
7034
|
var _events$userVerified;
|
|
7006
7035
|
const userVerifiedPayload = {
|
|
7007
7036
|
email: user.email,
|
|
7008
|
-
origin:
|
|
7037
|
+
origin: _interfaces__WEBPACK_IMPORTED_MODULE_13__.UserVerifiedOriginTypes.PASSWORDLESS,
|
|
7009
7038
|
id: user.id,
|
|
7010
7039
|
tenantId: user.tenantId,
|
|
7011
7040
|
createdAt: new Date(),
|
|
7012
7041
|
name: user.name
|
|
7013
7042
|
};
|
|
7014
7043
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
7015
|
-
(0,
|
|
7044
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_18__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_18__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
7016
7045
|
}
|
|
7017
7046
|
const loginCompletedPayload = {
|
|
7018
7047
|
tenantId: user.tenantId,
|
|
@@ -7022,7 +7051,7 @@ const _excluded = ["callback", "error"],
|
|
|
7022
7051
|
email: user.email,
|
|
7023
7052
|
name: user.name
|
|
7024
7053
|
};
|
|
7025
|
-
(0,
|
|
7054
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_18__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_18__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
7026
7055
|
if (user.id) {
|
|
7027
7056
|
localStorage.setItem('userId', user.id);
|
|
7028
7057
|
}
|
|
@@ -7037,11 +7066,11 @@ const _excluded = ["callback", "error"],
|
|
|
7037
7066
|
actions.setAuthState({
|
|
7038
7067
|
isLoading: false
|
|
7039
7068
|
});
|
|
7040
|
-
if (loginState.flow ===
|
|
7069
|
+
if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.Login) {
|
|
7041
7070
|
const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
|
|
7042
7071
|
if (shouldShowPrompt) {
|
|
7043
7072
|
actions.setLoginState({
|
|
7044
|
-
step:
|
|
7073
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.promptPasskeys,
|
|
7045
7074
|
loading: false
|
|
7046
7075
|
});
|
|
7047
7076
|
onRedirectTo(routes.loginUrl, {
|
|
@@ -7051,12 +7080,12 @@ const _excluded = ["callback", "error"],
|
|
|
7051
7080
|
actions.setAuthState({
|
|
7052
7081
|
isAuthenticated: true
|
|
7053
7082
|
});
|
|
7054
|
-
if (_payload.type ===
|
|
7083
|
+
if (_payload.type === _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.AuthStrategyEnum.MagicLink) {
|
|
7055
7084
|
actions.setLoginState({
|
|
7056
|
-
step:
|
|
7085
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.magicLinkPostLoginSuccess,
|
|
7057
7086
|
loading: false
|
|
7058
7087
|
});
|
|
7059
|
-
await (0,
|
|
7088
|
+
await (0,_helpers__WEBPACK_IMPORTED_MODULE_10__.delay)(5000);
|
|
7060
7089
|
}
|
|
7061
7090
|
await actions.afterAuthNavigation();
|
|
7062
7091
|
}
|
|
@@ -7070,7 +7099,7 @@ const _excluded = ["callback", "error"],
|
|
|
7070
7099
|
}
|
|
7071
7100
|
} catch (e) {
|
|
7072
7101
|
setLoginState({
|
|
7073
|
-
error: (0,
|
|
7102
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e, 'Failed to authenticate')
|
|
7074
7103
|
});
|
|
7075
7104
|
callback == null ? void 0 : callback(null, e);
|
|
7076
7105
|
} finally {
|
|
@@ -7094,7 +7123,7 @@ const _excluded = ["callback", "error"],
|
|
|
7094
7123
|
});
|
|
7095
7124
|
} catch (e) {
|
|
7096
7125
|
setLoginState({
|
|
7097
|
-
inviteTokenError: (0,
|
|
7126
|
+
inviteTokenError: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e, `We couldn't verify your invitation`)
|
|
7098
7127
|
});
|
|
7099
7128
|
} finally {
|
|
7100
7129
|
setLoginState({
|
|
@@ -7120,9 +7149,9 @@ const _excluded = ["callback", "error"],
|
|
|
7120
7149
|
const {
|
|
7121
7150
|
options
|
|
7122
7151
|
} = await api.auth.webAuthnPreLogin(body);
|
|
7123
|
-
options.challenge = (0,
|
|
7152
|
+
options.challenge = (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(options.challenge);
|
|
7124
7153
|
options.allowCredentials = (_options$allowCredent = options.allowCredentials) == null ? void 0 : _options$allowCredent.map(credentials => (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, credentials, {
|
|
7125
|
-
id: (0,
|
|
7154
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(credentials.id)
|
|
7126
7155
|
}));
|
|
7127
7156
|
setLoginState({
|
|
7128
7157
|
error: undefined
|
|
@@ -7130,7 +7159,7 @@ const _excluded = ["callback", "error"],
|
|
|
7130
7159
|
callback == null ? void 0 : callback(options);
|
|
7131
7160
|
} catch (e) {
|
|
7132
7161
|
setLoginState({
|
|
7133
|
-
error: (0,
|
|
7162
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7134
7163
|
});
|
|
7135
7164
|
callback == null ? void 0 : callback(null);
|
|
7136
7165
|
} finally {
|
|
@@ -7155,7 +7184,7 @@ const _excluded = ["callback", "error"],
|
|
|
7155
7184
|
setLoginState({
|
|
7156
7185
|
loading: true
|
|
7157
7186
|
});
|
|
7158
|
-
const publicKey = (0,
|
|
7187
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_23__.publicKeyCredentialToJSON)(body.publicKey);
|
|
7159
7188
|
const _await$api$auth$webAu = await api.auth.webAuthnPostLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, publicKey, {
|
|
7160
7189
|
response: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, publicKey.response, {
|
|
7161
7190
|
userHandle: (_publicKey$response$u = publicKey.response.userHandle) != null ? _publicKey$response$u : undefined
|
|
@@ -7167,7 +7196,7 @@ const _excluded = ["callback", "error"],
|
|
|
7167
7196
|
user
|
|
7168
7197
|
} = _await$api$auth$webAu,
|
|
7169
7198
|
rest = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__["default"])(_await$api$auth$webAu, _excluded9);
|
|
7170
|
-
if ((0,
|
|
7199
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
7171
7200
|
const {
|
|
7172
7201
|
routes,
|
|
7173
7202
|
onRedirectTo
|
|
@@ -7198,7 +7227,7 @@ const _excluded = ["callback", "error"],
|
|
|
7198
7227
|
email: user.email,
|
|
7199
7228
|
name: user.name
|
|
7200
7229
|
};
|
|
7201
|
-
(0,
|
|
7230
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_18__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_18__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
7202
7231
|
await actions.afterAuthNavigation();
|
|
7203
7232
|
// TODO: Itamar why moving callback to inside the else block
|
|
7204
7233
|
callback == null ? void 0 : callback(true);
|
|
@@ -7206,7 +7235,7 @@ const _excluded = ["callback", "error"],
|
|
|
7206
7235
|
// callback?.(true);
|
|
7207
7236
|
} catch (e) {
|
|
7208
7237
|
setLoginState({
|
|
7209
|
-
error: (0,
|
|
7238
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7210
7239
|
});
|
|
7211
7240
|
callback == null ? void 0 : callback(null);
|
|
7212
7241
|
} finally {
|
|
@@ -7231,13 +7260,13 @@ const _excluded = ["callback", "error"],
|
|
|
7231
7260
|
const {
|
|
7232
7261
|
options
|
|
7233
7262
|
} = await api.auth.webAuthnCreateNewDeviceSession();
|
|
7234
|
-
options.user.id = (0,
|
|
7235
|
-
options.challenge = (0,
|
|
7263
|
+
options.user.id = (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(options.user.id);
|
|
7264
|
+
options.challenge = (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(options.challenge);
|
|
7236
7265
|
options.excludeCredentials = [];
|
|
7237
7266
|
callback == null ? void 0 : callback(options);
|
|
7238
7267
|
} catch (e) {
|
|
7239
7268
|
setLoginState({
|
|
7240
|
-
error: (0,
|
|
7269
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7241
7270
|
});
|
|
7242
7271
|
callback == null ? void 0 : callback(null);
|
|
7243
7272
|
} finally {
|
|
@@ -7255,8 +7284,8 @@ const _excluded = ["callback", "error"],
|
|
|
7255
7284
|
setLoginState({
|
|
7256
7285
|
loading: true
|
|
7257
7286
|
});
|
|
7258
|
-
const publicKey = (0,
|
|
7259
|
-
const deviceType = (publicKey == null ? void 0 : publicKey.authenticatorAttachment) === 'platform' ?
|
|
7287
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_23__.publicKeyCredentialToJSON)(body.publicKey);
|
|
7288
|
+
const deviceType = (publicKey == null ? void 0 : publicKey.authenticatorAttachment) === 'platform' ? _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_24__.WebAuthnDeviceType.Platform : _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_24__.WebAuthnDeviceType.CrossPlatform;
|
|
7260
7289
|
await api.auth.verifyNewDeviceSession({
|
|
7261
7290
|
id: publicKey.id,
|
|
7262
7291
|
response: publicKey.response,
|
|
@@ -7265,7 +7294,7 @@ const _excluded = ["callback", "error"],
|
|
|
7265
7294
|
callback == null ? void 0 : callback(true);
|
|
7266
7295
|
} catch (e) {
|
|
7267
7296
|
setLoginState({
|
|
7268
|
-
error: (0,
|
|
7297
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7269
7298
|
});
|
|
7270
7299
|
callback == null ? void 0 : callback(null);
|
|
7271
7300
|
} finally {
|
|
@@ -7323,12 +7352,12 @@ const _excluded = ["callback", "error"],
|
|
|
7323
7352
|
var _data$options$exclude;
|
|
7324
7353
|
const data = await api.auth.preEnrollMFAWebAuthnForLogin(payload);
|
|
7325
7354
|
const options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, data.options, {
|
|
7326
|
-
challenge: (0,
|
|
7355
|
+
challenge: (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(data.options.challenge),
|
|
7327
7356
|
user: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, data.options.user, {
|
|
7328
|
-
id: (0,
|
|
7357
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(data.options.user.id)
|
|
7329
7358
|
}),
|
|
7330
7359
|
excludeCredentials: (_data$options$exclude = data.options.excludeCredentials) == null ? void 0 : _data$options$exclude.map(credentials => (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, credentials, {
|
|
7331
|
-
id: (0,
|
|
7360
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_22__.base64urlDecode)(credentials.id)
|
|
7332
7361
|
}))
|
|
7333
7362
|
});
|
|
7334
7363
|
setLoginState({
|
|
@@ -7341,7 +7370,7 @@ const _excluded = ["callback", "error"],
|
|
|
7341
7370
|
} catch (e) {
|
|
7342
7371
|
setLoginState({
|
|
7343
7372
|
loading: false,
|
|
7344
|
-
error: (0,
|
|
7373
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7345
7374
|
});
|
|
7346
7375
|
callback == null ? void 0 : callback(null);
|
|
7347
7376
|
}
|
|
@@ -7355,7 +7384,7 @@ const _excluded = ["callback", "error"],
|
|
|
7355
7384
|
loading: true
|
|
7356
7385
|
});
|
|
7357
7386
|
try {
|
|
7358
|
-
const publicKey = (0,
|
|
7387
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_23__.publicKeyCredentialToJSON)(payload.publicKey);
|
|
7359
7388
|
const data = await api.auth.enrollMFAWebAuthnForLoginV2((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, payload, {
|
|
7360
7389
|
options: publicKey
|
|
7361
7390
|
}));
|
|
@@ -7367,7 +7396,7 @@ const _excluded = ["callback", "error"],
|
|
|
7367
7396
|
} catch (e) {
|
|
7368
7397
|
setLoginState({
|
|
7369
7398
|
loading: false,
|
|
7370
|
-
error: (0,
|
|
7399
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7371
7400
|
});
|
|
7372
7401
|
callback == null ? void 0 : callback(null);
|
|
7373
7402
|
}
|
|
@@ -7390,7 +7419,7 @@ const _excluded = ["callback", "error"],
|
|
|
7390
7419
|
} catch (e) {
|
|
7391
7420
|
setLoginState({
|
|
7392
7421
|
loading: false,
|
|
7393
|
-
error: (0,
|
|
7422
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7394
7423
|
});
|
|
7395
7424
|
callback == null ? void 0 : callback(null);
|
|
7396
7425
|
}
|
|
@@ -7407,7 +7436,7 @@ const _excluded = ["callback", "error"],
|
|
|
7407
7436
|
const data = await api.auth.preEnrollMFASMSForLogin(payload);
|
|
7408
7437
|
actions.setMfaState({
|
|
7409
7438
|
otcToken: data.otcToken,
|
|
7410
|
-
step:
|
|
7439
|
+
step: _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_25__.MFAStep.smsVerifyCode,
|
|
7411
7440
|
phoneNumber: data.phoneNumber
|
|
7412
7441
|
});
|
|
7413
7442
|
setLoginState({
|
|
@@ -7417,7 +7446,7 @@ const _excluded = ["callback", "error"],
|
|
|
7417
7446
|
} catch (e) {
|
|
7418
7447
|
setLoginState({
|
|
7419
7448
|
loading: false,
|
|
7420
|
-
error: (0,
|
|
7449
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7421
7450
|
});
|
|
7422
7451
|
callback == null ? void 0 : callback(null);
|
|
7423
7452
|
}
|
|
@@ -7440,7 +7469,7 @@ const _excluded = ["callback", "error"],
|
|
|
7440
7469
|
} catch (e) {
|
|
7441
7470
|
setLoginState({
|
|
7442
7471
|
loading: false,
|
|
7443
|
-
error: (0,
|
|
7472
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7444
7473
|
});
|
|
7445
7474
|
callback == null ? void 0 : callback(null);
|
|
7446
7475
|
}
|
|
@@ -7452,7 +7481,7 @@ const _excluded = ["callback", "error"],
|
|
|
7452
7481
|
activeTenant
|
|
7453
7482
|
} = payload;
|
|
7454
7483
|
const mfaState = {
|
|
7455
|
-
step:
|
|
7484
|
+
step: _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_25__.MFAStep.recoveryCode,
|
|
7456
7485
|
loading: false,
|
|
7457
7486
|
error: undefined,
|
|
7458
7487
|
saving: false
|
|
@@ -7480,7 +7509,7 @@ const _excluded = ["callback", "error"],
|
|
|
7480
7509
|
setLoginState({
|
|
7481
7510
|
loading: false,
|
|
7482
7511
|
error: undefined,
|
|
7483
|
-
step:
|
|
7512
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.breachedPasswordSuccess
|
|
7484
7513
|
});
|
|
7485
7514
|
actions.setAuthState({
|
|
7486
7515
|
isAuthenticated: false
|
|
@@ -7488,7 +7517,7 @@ const _excluded = ["callback", "error"],
|
|
|
7488
7517
|
} catch (e) {
|
|
7489
7518
|
setLoginState({
|
|
7490
7519
|
loading: false,
|
|
7491
|
-
error: (0,
|
|
7520
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_15__.errorHandler)(e)
|
|
7492
7521
|
});
|
|
7493
7522
|
}
|
|
7494
7523
|
};
|
|
@@ -7543,8 +7572,8 @@ const _excluded = ["callback", "error"],
|
|
|
7543
7572
|
user,
|
|
7544
7573
|
tenants = [],
|
|
7545
7574
|
activeTenant
|
|
7546
|
-
} = await api.auth.refreshTokenV3();
|
|
7547
|
-
if ((0,
|
|
7575
|
+
} = await (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.refreshTokenWithRetry)(() => api.auth.refreshTokenV3());
|
|
7576
|
+
if ((0,_helpers__WEBPACK_IMPORTED_MODULE_5__.isMfaRequired)(user, store.root.appName)) {
|
|
7548
7577
|
const mfaRequiredState = await actions.getMfaRequiredState(user);
|
|
7549
7578
|
actions.setAuthState(mfaRequiredState);
|
|
7550
7579
|
onRedirectTo(routes.loginUrl, {
|
|
@@ -7555,7 +7584,7 @@ const _excluded = ["callback", "error"],
|
|
|
7555
7584
|
const shouldShowPrompt = await actions.__shouldShowPromptPasskeys();
|
|
7556
7585
|
if (shouldShowPrompt) {
|
|
7557
7586
|
actions.setLoginState({
|
|
7558
|
-
step:
|
|
7587
|
+
step: _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginStep.promptPasskeys,
|
|
7559
7588
|
loading: false
|
|
7560
7589
|
});
|
|
7561
7590
|
actions.afterAuthenticationStateUpdate({
|
|
@@ -7582,7 +7611,7 @@ const _excluded = ["callback", "error"],
|
|
|
7582
7611
|
}, {
|
|
7583
7612
|
loginState: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, loginState, {
|
|
7584
7613
|
quickLoginToRegister,
|
|
7585
|
-
flow: shouldNavigateToRegisterQuickLogin ?
|
|
7614
|
+
flow: shouldNavigateToRegisterQuickLogin ? _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.RegisterQuickLogin : _interfaces__WEBPACK_IMPORTED_MODULE_6__.LoginFlow.Login
|
|
7586
7615
|
}),
|
|
7587
7616
|
isAuthenticated: true
|
|
7588
7617
|
});
|
|
@@ -7640,7 +7669,7 @@ const _excluded = ["callback", "error"],
|
|
|
7640
7669
|
refreshTokenForSocialLogins,
|
|
7641
7670
|
// protected
|
|
7642
7671
|
__refreshToken
|
|
7643
|
-
}, (0,
|
|
7672
|
+
}, (0,_hostedLoginAuthorize_actions__WEBPACK_IMPORTED_MODULE_26__["default"])(store, api, sharedActions), (0,_afterAuthNavigation_actions__WEBPACK_IMPORTED_MODULE_27__["default"])(store, api, sharedActions), (0,_handleVerifyMFAResponse_actions__WEBPACK_IMPORTED_MODULE_28__["default"])(store, api, sharedActions), (0,_mfaRequiredState_actions__WEBPACK_IMPORTED_MODULE_29__["default"])(store, api, sharedActions), (0,_mfaWithAuthenticator_actions__WEBPACK_IMPORTED_MODULE_30__["default"])(store, api, sharedActions), (0,_mfaWithEmailCode_actions__WEBPACK_IMPORTED_MODULE_31__["default"])(store, api, sharedActions), (0,_mfaWithSMS_actions__WEBPACK_IMPORTED_MODULE_32__["default"])(store, api, sharedActions), (0,_mfaWithWebAuthn_actions__WEBPACK_IMPORTED_MODULE_33__["default"])(store, api, sharedActions));
|
|
7644
7673
|
});
|
|
7645
7674
|
|
|
7646
7675
|
/***/ }),
|
|
@@ -15924,6 +15953,7 @@ const STEP_UP_MAX_AGE_PARAM_NAME = 'maxAge';
|
|
|
15924
15953
|
"use strict";
|
|
15925
15954
|
__webpack_require__.r(__webpack_exports__);
|
|
15926
15955
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15956
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* binding */ getUrlDerivedStepUp),
|
|
15927
15957
|
/* harmony export */ isSteppedUp: () => (/* binding */ isSteppedUp),
|
|
15928
15958
|
/* harmony export */ redirectByStepUpUrl: () => (/* binding */ redirectByStepUpUrl),
|
|
15929
15959
|
/* harmony export */ setAfterAuthRedirectUrlForStepUp: () => (/* binding */ setAfterAuthRedirectUrlForStepUp)
|
|
@@ -15948,16 +15978,38 @@ const isSteppedUp = (user, {
|
|
|
15948
15978
|
acr = '',
|
|
15949
15979
|
auth_time
|
|
15950
15980
|
} = user;
|
|
15951
|
-
if (maxAge
|
|
15952
|
-
//
|
|
15953
|
-
|
|
15954
|
-
|
|
15981
|
+
if (maxAge) {
|
|
15982
|
+
// max_age requires a verifiable, fresh auth_time; a missing or stale one is not stepped up.
|
|
15983
|
+
if (!auth_time || Date.now() / 1000 - auth_time > maxAge) {
|
|
15984
|
+
return false;
|
|
15985
|
+
}
|
|
15955
15986
|
}
|
|
15956
15987
|
const isACRValid = acr === _consts__WEBPACK_IMPORTED_MODULE_0__.ACR_VALUE;
|
|
15957
15988
|
const isAMRIncludesMFA = amr.indexOf(_consts__WEBPACK_IMPORTED_MODULE_0__.AMR_MFA_VALUE) !== -1;
|
|
15958
15989
|
const isAMRIncludesMethod = _consts__WEBPACK_IMPORTED_MODULE_0__.AMR_ADDITIONAL_VALUE.find(method => amr.indexOf(method)) !== undefined;
|
|
15959
15990
|
return isACRValid && isAMRIncludesMFA && isAMRIncludesMethod;
|
|
15960
15991
|
};
|
|
15992
|
+
const getUrlDerivedStepUp = () => {
|
|
15993
|
+
if (typeof window === 'undefined') {
|
|
15994
|
+
return {
|
|
15995
|
+
isStepUpRequested: false
|
|
15996
|
+
};
|
|
15997
|
+
}
|
|
15998
|
+
try {
|
|
15999
|
+
const params = new URLSearchParams(window.location.search);
|
|
16000
|
+
const acrValues = params.get('acr_values');
|
|
16001
|
+
const maxAgeParam = params.get('max_age');
|
|
16002
|
+
const maxAge = maxAgeParam !== null && maxAgeParam !== '' ? Number(maxAgeParam) : undefined;
|
|
16003
|
+
return {
|
|
16004
|
+
isStepUpRequested: acrValues === _consts__WEBPACK_IMPORTED_MODULE_0__.ACR_VALUE,
|
|
16005
|
+
maxAge: maxAge !== undefined && Number.isFinite(maxAge) ? maxAge : undefined
|
|
16006
|
+
};
|
|
16007
|
+
} catch {
|
|
16008
|
+
return {
|
|
16009
|
+
isStepUpRequested: false
|
|
16010
|
+
};
|
|
16011
|
+
}
|
|
16012
|
+
};
|
|
15961
16013
|
|
|
15962
16014
|
/**
|
|
15963
16015
|
* Set the url and query params in the local storage FRONTEGG_AFTER_AUTH_REDIRECT_URL value
|
|
@@ -18141,6 +18193,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18141
18193
|
/* harmony export */ getSearchParam: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParam),
|
|
18142
18194
|
/* harmony export */ getSearchParamsFromUrl: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParamsFromUrl),
|
|
18143
18195
|
/* harmony export */ getUri: () => (/* binding */ getUri),
|
|
18196
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* reexport safe */ _StepUpState_helpers__WEBPACK_IMPORTED_MODULE_4__.getUrlDerivedStepUp),
|
|
18144
18197
|
/* harmony export */ isAbsoluteUrl: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbsoluteUrl),
|
|
18145
18198
|
/* harmony export */ isAuthRoute: () => (/* binding */ isAuthRoute),
|
|
18146
18199
|
/* harmony export */ isEmailPayload: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isEmailPayload),
|
|
@@ -19819,10 +19872,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19819
19872
|
/* harmony export */ omitProps: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.omitProps),
|
|
19820
19873
|
/* harmony export */ publicKeyCredentialToJSON: () => (/* reexport safe */ _converters__WEBPACK_IMPORTED_MODULE_2__.publicKeyCredentialToJSON),
|
|
19821
19874
|
/* harmony export */ readFileAsText: () => (/* reexport safe */ _converters__WEBPACK_IMPORTED_MODULE_2__.readFileAsText),
|
|
19875
|
+
/* harmony export */ refreshTokenWithRetry: () => (/* reexport safe */ _refreshTokenRetry__WEBPACK_IMPORTED_MODULE_7__.refreshTokenWithRetry),
|
|
19822
19876
|
/* harmony export */ reportGTMEvent: () => (/* reexport safe */ _gtm__WEBPACK_IMPORTED_MODULE_5__.reportGTMEvent),
|
|
19823
19877
|
/* harmony export */ retry: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.retry),
|
|
19824
19878
|
/* harmony export */ retryIfNeeded: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.retryIfNeeded),
|
|
19825
19879
|
/* harmony export */ sha256: () => (/* reexport safe */ _sha256__WEBPACK_IMPORTED_MODULE_6__.sha256),
|
|
19880
|
+
/* harmony export */ shouldRetryRefreshTokenError: () => (/* reexport safe */ _refreshTokenRetry__WEBPACK_IMPORTED_MODULE_7__.shouldRetryRefreshTokenError),
|
|
19826
19881
|
/* harmony export */ withRetryConfig: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_0__.withRetryConfig)
|
|
19827
19882
|
/* harmony export */ });
|
|
19828
19883
|
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
@@ -19832,6 +19887,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19832
19887
|
/* harmony import */ var _random__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./random */ "../../dist/@frontegg/redux-store/helpers/random.js");
|
|
19833
19888
|
/* harmony import */ var _gtm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./gtm */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
19834
19889
|
/* harmony import */ var _sha256__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sha256 */ "../../dist/@frontegg/redux-store/helpers/sha256.js");
|
|
19890
|
+
/* harmony import */ var _refreshTokenRetry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./refreshTokenRetry */ "../../dist/@frontegg/redux-store/helpers/refreshTokenRetry.js");
|
|
19891
|
+
|
|
19835
19892
|
|
|
19836
19893
|
|
|
19837
19894
|
|
|
@@ -19888,6 +19945,58 @@ function createRandomString(length = 16) {
|
|
|
19888
19945
|
|
|
19889
19946
|
/***/ }),
|
|
19890
19947
|
|
|
19948
|
+
/***/ "../../dist/@frontegg/redux-store/helpers/refreshTokenRetry.js":
|
|
19949
|
+
/*!*********************************************************************!*\
|
|
19950
|
+
!*** ../../dist/@frontegg/redux-store/helpers/refreshTokenRetry.js ***!
|
|
19951
|
+
\*********************************************************************/
|
|
19952
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
19953
|
+
|
|
19954
|
+
"use strict";
|
|
19955
|
+
__webpack_require__.r(__webpack_exports__);
|
|
19956
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19957
|
+
/* harmony export */ refreshTokenWithRetry: () => (/* binding */ refreshTokenWithRetry),
|
|
19958
|
+
/* harmony export */ shouldRetryRefreshTokenError: () => (/* binding */ shouldRetryRefreshTokenError)
|
|
19959
|
+
/* harmony export */ });
|
|
19960
|
+
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
19961
|
+
|
|
19962
|
+
const REFRESH_TOKEN_RETRY_DELAYS = [1000, 2000];
|
|
19963
|
+
const getRefreshTokenErrorStatusCode = error => {
|
|
19964
|
+
var _ref, _apiError$statusCode, _apiError$response;
|
|
19965
|
+
const apiError = error;
|
|
19966
|
+
return (_ref = (_apiError$statusCode = apiError.statusCode) != null ? _apiError$statusCode : apiError.status) != null ? _ref : (_apiError$response = apiError.response) == null ? void 0 : _apiError$response.status;
|
|
19967
|
+
};
|
|
19968
|
+
const shouldRetryRefreshTokenError = error => {
|
|
19969
|
+
var _message$toLowerCase, _message;
|
|
19970
|
+
const statusCode = getRefreshTokenErrorStatusCode(error);
|
|
19971
|
+
const errorName = error == null ? void 0 : error.name;
|
|
19972
|
+
const errorMessage = (_message$toLowerCase = error == null ? void 0 : (_message = error.message) == null ? void 0 : _message.toLowerCase()) != null ? _message$toLowerCase : '';
|
|
19973
|
+
if (statusCode === 401 || statusCode === 403) {
|
|
19974
|
+
return false;
|
|
19975
|
+
}
|
|
19976
|
+
if (statusCode === 410) {
|
|
19977
|
+
return true;
|
|
19978
|
+
}
|
|
19979
|
+
if (statusCode !== undefined) {
|
|
19980
|
+
return statusCode === 0 || statusCode >= 500 && statusCode < 600;
|
|
19981
|
+
}
|
|
19982
|
+
return errorName === 'AbortError' || errorMessage.includes('network') || errorMessage.includes('failed to fetch') || errorMessage.includes('fetch failed') || errorMessage.includes('load failed') || errorMessage.includes('native_bridge_timeout');
|
|
19983
|
+
};
|
|
19984
|
+
const refreshTokenWithRetry = async refreshRequest => {
|
|
19985
|
+
for (let attempt = 0; attempt <= REFRESH_TOKEN_RETRY_DELAYS.length; attempt++) {
|
|
19986
|
+
try {
|
|
19987
|
+
return await refreshRequest();
|
|
19988
|
+
} catch (error) {
|
|
19989
|
+
if (attempt >= REFRESH_TOKEN_RETRY_DELAYS.length || !shouldRetryRefreshTokenError(error)) {
|
|
19990
|
+
throw error;
|
|
19991
|
+
}
|
|
19992
|
+
await (0,_common__WEBPACK_IMPORTED_MODULE_0__.delay)(REFRESH_TOKEN_RETRY_DELAYS[attempt]);
|
|
19993
|
+
}
|
|
19994
|
+
}
|
|
19995
|
+
return await refreshRequest();
|
|
19996
|
+
};
|
|
19997
|
+
|
|
19998
|
+
/***/ }),
|
|
19999
|
+
|
|
19891
20000
|
/***/ "../../dist/@frontegg/redux-store/helpers/sha256.js":
|
|
19892
20001
|
/*!**********************************************************!*\
|
|
19893
20002
|
!*** ../../dist/@frontegg/redux-store/helpers/sha256.js ***!
|
|
@@ -20437,6 +20546,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20437
20546
|
/* harmony export */ getSearchParam: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParam),
|
|
20438
20547
|
/* harmony export */ getSearchParamsFromUrl: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParamsFromUrl),
|
|
20439
20548
|
/* harmony export */ getUri: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getUri),
|
|
20549
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getUrlDerivedStepUp),
|
|
20440
20550
|
/* harmony export */ hmac: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.hmac),
|
|
20441
20551
|
/* harmony export */ isAbsoluteUrl: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbsoluteUrl),
|
|
20442
20552
|
/* harmony export */ isAuthRoute: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isAuthRoute),
|
|
@@ -20459,11 +20569,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20459
20569
|
/* harmony export */ readFileAsText: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.readFileAsText),
|
|
20460
20570
|
/* harmony export */ redirectByStepUpUrl: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.redirectByStepUpUrl),
|
|
20461
20571
|
/* harmony export */ ref: () => (/* reexport safe */ _toolkit__WEBPACK_IMPORTED_MODULE_0__.ref),
|
|
20572
|
+
/* harmony export */ refreshTokenWithRetry: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.refreshTokenWithRetry),
|
|
20462
20573
|
/* harmony export */ reportGTMEvent: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.reportGTMEvent),
|
|
20463
20574
|
/* harmony export */ retry: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.retry),
|
|
20464
20575
|
/* harmony export */ retryIfNeeded: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.retryIfNeeded),
|
|
20465
20576
|
/* harmony export */ setAfterAuthRedirectUrlForStepUp: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.setAfterAuthRedirectUrlForStepUp),
|
|
20466
20577
|
/* harmony export */ sha256: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.sha256),
|
|
20578
|
+
/* harmony export */ shouldRetryRefreshTokenError: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.shouldRetryRefreshTokenError),
|
|
20467
20579
|
/* harmony export */ shouldShowPasswordRotationPromptFunc: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.shouldShowPasswordRotationPromptFunc),
|
|
20468
20580
|
/* harmony export */ snapshot: () => (/* reexport safe */ _toolkit__WEBPACK_IMPORTED_MODULE_0__.snapshot),
|
|
20469
20581
|
/* harmony export */ subscribe: () => (/* reexport safe */ _toolkit__WEBPACK_IMPORTED_MODULE_0__.subscribe),
|
|
@@ -20478,7 +20590,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20478
20590
|
/* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
|
|
20479
20591
|
/* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
|
|
20480
20592
|
/* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
|
|
20481
|
-
/** @license Frontegg v7.
|
|
20593
|
+
/** @license Frontegg v7.116.0
|
|
20482
20594
|
*
|
|
20483
20595
|
* This source code is licensed under the MIT license found in the
|
|
20484
20596
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -31135,7 +31247,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31135
31247
|
/* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
|
|
31136
31248
|
/* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
|
|
31137
31249
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
|
|
31138
|
-
/** @license Frontegg v7.
|
|
31250
|
+
/** @license Frontegg v7.116.0
|
|
31139
31251
|
*
|
|
31140
31252
|
* This source code is licensed under the MIT license found in the
|
|
31141
31253
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -33932,7 +34044,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33932
34044
|
/* harmony export */ });
|
|
33933
34045
|
/* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
|
|
33934
34046
|
/* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
|
|
33935
|
-
/** @license Frontegg v7.
|
|
34047
|
+
/** @license Frontegg v7.116.0
|
|
33936
34048
|
*
|
|
33937
34049
|
* This source code is licensed under the MIT license found in the
|
|
33938
34050
|
* LICENSE file in the root directory of this source tree.
|