@frontegg/js 7.114.0 → 7.115.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 +60 -15
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +1 -1
- package/version.js +1 -1
package/index.js
CHANGED
package/node/index.js
CHANGED
package/node/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/js",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.115.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
|
-
"@frontegg/types": "7.
|
|
9
|
+
"@frontegg/types": "7.115.0"
|
|
10
10
|
},
|
|
11
11
|
"browserslist": {
|
|
12
12
|
"production": [
|
|
@@ -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.115.0'
|
|
1928
1928
|
});
|
|
1929
1929
|
|
|
1930
1930
|
/***/ }),
|
|
@@ -5867,11 +5867,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
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
5869
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/random.js");
|
|
5870
|
-
/* harmony import */ var
|
|
5870
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
5871
5871
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
|
|
5872
5872
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
5873
5873
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
5874
|
-
/* harmony import */ var
|
|
5874
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/StepUpState/helpers.js");
|
|
5875
5875
|
/* harmony import */ var _StepUpState_consts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../StepUpState/consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
|
|
5876
5876
|
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
|
|
5877
5877
|
|
|
@@ -5990,7 +5990,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5990
5990
|
}
|
|
5991
5991
|
};
|
|
5992
5992
|
const refreshOrRequestHostedLoginAuthorizeV2 = async payload => {
|
|
5993
|
-
var
|
|
5993
|
+
var _additionalParams;
|
|
5994
5994
|
const {
|
|
5995
5995
|
shouldRedirectToLogin,
|
|
5996
5996
|
firstTime,
|
|
@@ -5999,8 +5999,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5999
5999
|
let {
|
|
6000
6000
|
additionalParams
|
|
6001
6001
|
} = payload != null ? payload : {};
|
|
6002
|
-
|
|
6003
|
-
|
|
6002
|
+
const urlDerivedStepUp = (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.getUrlDerivedStepUp)();
|
|
6003
|
+
const isNativeStepUp = _toolkit__WEBPACK_IMPORTED_MODULE_1__["default"].isGetTokensAvailable() && urlDerivedStepUp.isStepUpRequested;
|
|
6004
|
+
if (!isNativeStepUp) {
|
|
6005
|
+
var _localStorage2;
|
|
6006
|
+
(_localStorage2 = localStorage) == null ? void 0 : _localStorage2.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_6__.SHOULD_STEP_UP_KEY);
|
|
6007
|
+
}
|
|
6004
6008
|
if (firstTime) {
|
|
6005
6009
|
const urlStrategy = store.root.urlStrategy;
|
|
6006
6010
|
const activeUri = (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.getUri)(urlStrategy);
|
|
@@ -6022,6 +6026,22 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6022
6026
|
if (((_additionalParams = additionalParams) == null ? void 0 : _additionalParams['prompt']) === 'login') {
|
|
6023
6027
|
return await requestHostedLoginAuthorize(additionalParams);
|
|
6024
6028
|
}
|
|
6029
|
+
if (isNativeStepUp && !(0,_helpers__WEBPACK_IMPORTED_MODULE_7__.isSteppedUp)(store.auth.user, {
|
|
6030
|
+
maxAge: urlDerivedStepUp.maxAge
|
|
6031
|
+
})) {
|
|
6032
|
+
const {
|
|
6033
|
+
routes,
|
|
6034
|
+
onRedirectTo
|
|
6035
|
+
} = store.auth;
|
|
6036
|
+
if (routes.stepUpUrl && !window.location.href.includes(routes.stepUpUrl)) {
|
|
6037
|
+
window.localStorage.setItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_6__.SHOULD_STEP_UP_KEY, 'true');
|
|
6038
|
+
actions.setAuthState({
|
|
6039
|
+
isLoading: true
|
|
6040
|
+
});
|
|
6041
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_7__.redirectByStepUpUrl)(routes.stepUpUrl, onRedirectTo, urlDerivedStepUp.maxAge);
|
|
6042
|
+
return;
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6025
6045
|
try {
|
|
6026
6046
|
if (disableSilentRefresh) {
|
|
6027
6047
|
throw new Error('silent refresh is disabled');
|
|
@@ -6076,7 +6096,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6076
6096
|
email: user == null ? void 0 : user.email,
|
|
6077
6097
|
name: user == null ? void 0 : user.name
|
|
6078
6098
|
};
|
|
6079
|
-
(0,
|
|
6099
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_8__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_8__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6080
6100
|
}
|
|
6081
6101
|
} catch (e) {
|
|
6082
6102
|
actions.setAuthState({
|
|
@@ -6088,7 +6108,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6088
6108
|
window.localStorage.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_6__.SHOULD_STEP_UP_KEY);
|
|
6089
6109
|
|
|
6090
6110
|
// when the user pause the step up flow we may still have the key in the local storage in hosted. Ignore it.
|
|
6091
|
-
if (isStepUpFlow && (0,
|
|
6111
|
+
if (isStepUpFlow && (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.isSteppedUp)(user)) {
|
|
6092
6112
|
await actions.afterStepUpAuthNavigation();
|
|
6093
6113
|
} else {
|
|
6094
6114
|
await actions.afterAuthNavigation();
|
|
@@ -15924,6 +15944,7 @@ const STEP_UP_MAX_AGE_PARAM_NAME = 'maxAge';
|
|
|
15924
15944
|
"use strict";
|
|
15925
15945
|
__webpack_require__.r(__webpack_exports__);
|
|
15926
15946
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15947
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* binding */ getUrlDerivedStepUp),
|
|
15927
15948
|
/* harmony export */ isSteppedUp: () => (/* binding */ isSteppedUp),
|
|
15928
15949
|
/* harmony export */ redirectByStepUpUrl: () => (/* binding */ redirectByStepUpUrl),
|
|
15929
15950
|
/* harmony export */ setAfterAuthRedirectUrlForStepUp: () => (/* binding */ setAfterAuthRedirectUrlForStepUp)
|
|
@@ -15948,16 +15969,38 @@ const isSteppedUp = (user, {
|
|
|
15948
15969
|
acr = '',
|
|
15949
15970
|
auth_time
|
|
15950
15971
|
} = user;
|
|
15951
|
-
if (maxAge
|
|
15952
|
-
//
|
|
15953
|
-
|
|
15954
|
-
|
|
15972
|
+
if (maxAge) {
|
|
15973
|
+
// max_age requires a verifiable, fresh auth_time; a missing or stale one is not stepped up.
|
|
15974
|
+
if (!auth_time || Date.now() / 1000 - auth_time > maxAge) {
|
|
15975
|
+
return false;
|
|
15976
|
+
}
|
|
15955
15977
|
}
|
|
15956
15978
|
const isACRValid = acr === _consts__WEBPACK_IMPORTED_MODULE_0__.ACR_VALUE;
|
|
15957
15979
|
const isAMRIncludesMFA = amr.indexOf(_consts__WEBPACK_IMPORTED_MODULE_0__.AMR_MFA_VALUE) !== -1;
|
|
15958
15980
|
const isAMRIncludesMethod = _consts__WEBPACK_IMPORTED_MODULE_0__.AMR_ADDITIONAL_VALUE.find(method => amr.indexOf(method)) !== undefined;
|
|
15959
15981
|
return isACRValid && isAMRIncludesMFA && isAMRIncludesMethod;
|
|
15960
15982
|
};
|
|
15983
|
+
const getUrlDerivedStepUp = () => {
|
|
15984
|
+
if (typeof window === 'undefined') {
|
|
15985
|
+
return {
|
|
15986
|
+
isStepUpRequested: false
|
|
15987
|
+
};
|
|
15988
|
+
}
|
|
15989
|
+
try {
|
|
15990
|
+
const params = new URLSearchParams(window.location.search);
|
|
15991
|
+
const acrValues = params.get('acr_values');
|
|
15992
|
+
const maxAgeParam = params.get('max_age');
|
|
15993
|
+
const maxAge = maxAgeParam !== null && maxAgeParam !== '' ? Number(maxAgeParam) : undefined;
|
|
15994
|
+
return {
|
|
15995
|
+
isStepUpRequested: acrValues === _consts__WEBPACK_IMPORTED_MODULE_0__.ACR_VALUE,
|
|
15996
|
+
maxAge: maxAge !== undefined && Number.isFinite(maxAge) ? maxAge : undefined
|
|
15997
|
+
};
|
|
15998
|
+
} catch {
|
|
15999
|
+
return {
|
|
16000
|
+
isStepUpRequested: false
|
|
16001
|
+
};
|
|
16002
|
+
}
|
|
16003
|
+
};
|
|
15961
16004
|
|
|
15962
16005
|
/**
|
|
15963
16006
|
* Set the url and query params in the local storage FRONTEGG_AFTER_AUTH_REDIRECT_URL value
|
|
@@ -18141,6 +18184,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18141
18184
|
/* harmony export */ getSearchParam: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParam),
|
|
18142
18185
|
/* harmony export */ getSearchParamsFromUrl: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParamsFromUrl),
|
|
18143
18186
|
/* harmony export */ getUri: () => (/* binding */ getUri),
|
|
18187
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* reexport safe */ _StepUpState_helpers__WEBPACK_IMPORTED_MODULE_4__.getUrlDerivedStepUp),
|
|
18144
18188
|
/* harmony export */ isAbsoluteUrl: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbsoluteUrl),
|
|
18145
18189
|
/* harmony export */ isAuthRoute: () => (/* binding */ isAuthRoute),
|
|
18146
18190
|
/* harmony export */ isEmailPayload: () => (/* reexport safe */ _LoginState_helpers__WEBPACK_IMPORTED_MODULE_3__.isEmailPayload),
|
|
@@ -20437,6 +20481,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20437
20481
|
/* harmony export */ getSearchParam: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParam),
|
|
20438
20482
|
/* harmony export */ getSearchParamsFromUrl: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getSearchParamsFromUrl),
|
|
20439
20483
|
/* harmony export */ getUri: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getUri),
|
|
20484
|
+
/* harmony export */ getUrlDerivedStepUp: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.getUrlDerivedStepUp),
|
|
20440
20485
|
/* harmony export */ hmac: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_2__.hmac),
|
|
20441
20486
|
/* harmony export */ isAbsoluteUrl: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isAbsoluteUrl),
|
|
20442
20487
|
/* harmony export */ isAuthRoute: () => (/* reexport safe */ _auth_helpers__WEBPACK_IMPORTED_MODULE_3__.isAuthRoute),
|
|
@@ -20478,7 +20523,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20478
20523
|
/* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
|
|
20479
20524
|
/* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
|
|
20480
20525
|
/* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
|
|
20481
|
-
/** @license Frontegg v7.
|
|
20526
|
+
/** @license Frontegg v7.115.0
|
|
20482
20527
|
*
|
|
20483
20528
|
* This source code is licensed under the MIT license found in the
|
|
20484
20529
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -31135,7 +31180,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31135
31180
|
/* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
|
|
31136
31181
|
/* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
|
|
31137
31182
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
|
|
31138
|
-
/** @license Frontegg v7.
|
|
31183
|
+
/** @license Frontegg v7.115.0
|
|
31139
31184
|
*
|
|
31140
31185
|
* This source code is licensed under the MIT license found in the
|
|
31141
31186
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -33932,7 +33977,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33932
33977
|
/* harmony export */ });
|
|
33933
33978
|
/* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
|
|
33934
33979
|
/* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
|
|
33935
|
-
/** @license Frontegg v7.
|
|
33980
|
+
/** @license Frontegg v7.115.0
|
|
33936
33981
|
*
|
|
33937
33982
|
* This source code is licensed under the MIT license found in the
|
|
33938
33983
|
* LICENSE file in the root directory of this source tree.
|