@frontegg/js 7.103.0-alpha.1 → 7.103.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/FronteggApp/FronteggApp.d.ts +2 -0
- package/FronteggApp/FronteggApp.js +80 -38
- package/index.js +1 -1
- package/node/FronteggApp/FronteggApp.js +80 -38
- package/node/index.js +1 -1
- package/node/version.js +1 -1
- package/package.json +2 -2
- package/umd/frontegg.development.js +226 -66
- package/umd/frontegg.production.min.js +1 -1
- package/umd/frontegg.production.min.js.LICENSE.txt +1 -1
- package/version.js +1 -1
|
@@ -749,6 +749,48 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
749
749
|
return _ref12.apply(this, arguments);
|
|
750
750
|
};
|
|
751
751
|
}();
|
|
752
|
+
this.renderScimGuideDialog = /*#__PURE__*/function () {
|
|
753
|
+
var _ref13 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee13(container, props, options) {
|
|
754
|
+
var FronteggAdminPortal;
|
|
755
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee13$(_context13) {
|
|
756
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
757
|
+
case 0:
|
|
758
|
+
_context13.next = 2;
|
|
759
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
760
|
+
case 2:
|
|
761
|
+
FronteggAdminPortal = _context13.sent;
|
|
762
|
+
return _context13.abrupt("return", FronteggAdminPortal.renderScimGuideDialog(container, _this.createCMCRenderOptions(props, options)));
|
|
763
|
+
case 4:
|
|
764
|
+
case "end":
|
|
765
|
+
return _context13.stop();
|
|
766
|
+
}
|
|
767
|
+
}, _callee13);
|
|
768
|
+
}));
|
|
769
|
+
return function (_x22, _x23, _x24) {
|
|
770
|
+
return _ref13.apply(this, arguments);
|
|
771
|
+
};
|
|
772
|
+
}();
|
|
773
|
+
this.getScimGuideDialogStore = /*#__PURE__*/function () {
|
|
774
|
+
var _ref14 = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee14(options) {
|
|
775
|
+
var FronteggAdminPortal;
|
|
776
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee14$(_context14) {
|
|
777
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
778
|
+
case 0:
|
|
779
|
+
_context14.next = 2;
|
|
780
|
+
return _this.loadScript('FronteggAdminPortal');
|
|
781
|
+
case 2:
|
|
782
|
+
FronteggAdminPortal = _context14.sent;
|
|
783
|
+
return _context14.abrupt("return", FronteggAdminPortal.useScimGuideDialogStore(options));
|
|
784
|
+
case 4:
|
|
785
|
+
case "end":
|
|
786
|
+
return _context14.stop();
|
|
787
|
+
}
|
|
788
|
+
}, _callee14);
|
|
789
|
+
}));
|
|
790
|
+
return function (_x25) {
|
|
791
|
+
return _ref14.apply(this, arguments);
|
|
792
|
+
};
|
|
793
|
+
}();
|
|
752
794
|
var appName = (0,_utils__WEBPACK_IMPORTED_MODULE_5__.formatName)(name);
|
|
753
795
|
var customElementName = "frontegg-app-".concat(appName);
|
|
754
796
|
this.iframeRendering = iframeRendering;
|
|
@@ -841,9 +883,9 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
841
883
|
}, {
|
|
842
884
|
key: "initContainers",
|
|
843
885
|
value: function () {
|
|
844
|
-
var _initContainers = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function
|
|
845
|
-
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function
|
|
846
|
-
while (1) switch (
|
|
886
|
+
var _initContainers = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee15(elements) {
|
|
887
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee15$(_context15) {
|
|
888
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
847
889
|
case 0:
|
|
848
890
|
this.adminPortalEl = elements.adminPortalEl;
|
|
849
891
|
this.loginBoxEl = elements.loginBoxEl;
|
|
@@ -858,7 +900,7 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
858
900
|
} catch (e) {
|
|
859
901
|
console.error('Failed to add frontegg-loading to body classList');
|
|
860
902
|
}
|
|
861
|
-
|
|
903
|
+
_context15.next = 9;
|
|
862
904
|
return Promise.all([this.loadFeatureFlags(), this.loadAdminBoxMetadata(), this.requestAuthorize()]);
|
|
863
905
|
case 9:
|
|
864
906
|
if (!this.options.previewMode && !this.options.customLoginBox) {
|
|
@@ -870,11 +912,11 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
870
912
|
}
|
|
871
913
|
case 11:
|
|
872
914
|
case "end":
|
|
873
|
-
return
|
|
915
|
+
return _context15.stop();
|
|
874
916
|
}
|
|
875
|
-
},
|
|
917
|
+
}, _callee15, this);
|
|
876
918
|
}));
|
|
877
|
-
function initContainers(
|
|
919
|
+
function initContainers(_x26) {
|
|
878
920
|
return _initContainers.apply(this, arguments);
|
|
879
921
|
}
|
|
880
922
|
return initContainers;
|
|
@@ -989,15 +1031,15 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
989
1031
|
}, {
|
|
990
1032
|
key: "loadLoginBox",
|
|
991
1033
|
value: function () {
|
|
992
|
-
var _loadLoginBox = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function
|
|
1034
|
+
var _loadLoginBox = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee16() {
|
|
993
1035
|
var FronteggLoginBox;
|
|
994
|
-
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function
|
|
995
|
-
while (1) switch (
|
|
1036
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee16$(_context16) {
|
|
1037
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
996
1038
|
case 0:
|
|
997
|
-
|
|
1039
|
+
_context16.next = 2;
|
|
998
1040
|
return this.loadScript('FronteggLoginBox');
|
|
999
1041
|
case 2:
|
|
1000
|
-
FronteggLoginBox =
|
|
1042
|
+
FronteggLoginBox = _context16.sent;
|
|
1001
1043
|
FronteggLoginBox.render(this.loginBoxEl, {
|
|
1002
1044
|
injector: this,
|
|
1003
1045
|
options: this.options
|
|
@@ -1013,9 +1055,9 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1013
1055
|
this.loadingListeners = [];
|
|
1014
1056
|
case 7:
|
|
1015
1057
|
case "end":
|
|
1016
|
-
return
|
|
1058
|
+
return _context16.stop();
|
|
1017
1059
|
}
|
|
1018
|
-
},
|
|
1060
|
+
}, _callee16, this);
|
|
1019
1061
|
}));
|
|
1020
1062
|
function loadLoginBox() {
|
|
1021
1063
|
return _loadLoginBox.apply(this, arguments);
|
|
@@ -1025,20 +1067,20 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1025
1067
|
}, {
|
|
1026
1068
|
key: "showAdminPortal",
|
|
1027
1069
|
value: function () {
|
|
1028
|
-
var _showAdminPortal = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function
|
|
1029
|
-
var
|
|
1030
|
-
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function
|
|
1031
|
-
while (1) switch (
|
|
1070
|
+
var _showAdminPortal = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee17(options) {
|
|
1071
|
+
var _ref15, isMultiApp, _this$queryFeatureFla, _this$queryFeatureFla2, multiAppsFlag, FronteggAdminPortal;
|
|
1072
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee17$(_context17) {
|
|
1073
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1032
1074
|
case 0:
|
|
1033
|
-
|
|
1075
|
+
_ref15 = options != null ? options : {
|
|
1034
1076
|
isMultiApp: false
|
|
1035
|
-
}, isMultiApp =
|
|
1077
|
+
}, isMultiApp = _ref15.isMultiApp;
|
|
1036
1078
|
_this$queryFeatureFla = this.queryFeatureFlags(['multi-apps-admin-portal']), _this$queryFeatureFla2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$queryFeatureFla, 1), multiAppsFlag = _this$queryFeatureFla2[0];
|
|
1037
1079
|
_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.ContextHolder["for"](this.name).setRequestSource(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_21__.RequestSource.AdminPortal);
|
|
1038
|
-
|
|
1080
|
+
_context17.next = 5;
|
|
1039
1081
|
return this.loadScript('FronteggAdminPortal');
|
|
1040
1082
|
case 5:
|
|
1041
|
-
FronteggAdminPortal =
|
|
1083
|
+
FronteggAdminPortal = _context17.sent;
|
|
1042
1084
|
this.adminPortalRenderer = FronteggAdminPortal.render(this.adminPortalEl, {
|
|
1043
1085
|
injector: this,
|
|
1044
1086
|
options: Object.assign({
|
|
@@ -1047,11 +1089,11 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1047
1089
|
});
|
|
1048
1090
|
case 7:
|
|
1049
1091
|
case "end":
|
|
1050
|
-
return
|
|
1092
|
+
return _context17.stop();
|
|
1051
1093
|
}
|
|
1052
|
-
},
|
|
1094
|
+
}, _callee17, this);
|
|
1053
1095
|
}));
|
|
1054
|
-
function showAdminPortal(
|
|
1096
|
+
function showAdminPortal(_x27) {
|
|
1055
1097
|
return _showAdminPortal.apply(this, arguments);
|
|
1056
1098
|
}
|
|
1057
1099
|
return showAdminPortal;
|
|
@@ -1090,15 +1132,15 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1090
1132
|
}, {
|
|
1091
1133
|
key: "showCheckoutDialog",
|
|
1092
1134
|
value: function () {
|
|
1093
|
-
var _showCheckoutDialog = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function
|
|
1135
|
+
var _showCheckoutDialog = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee18(opts) {
|
|
1094
1136
|
var FronteggAdminPortal;
|
|
1095
|
-
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function
|
|
1096
|
-
while (1) switch (
|
|
1137
|
+
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee18$(_context18) {
|
|
1138
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1097
1139
|
case 0:
|
|
1098
|
-
|
|
1140
|
+
_context18.next = 2;
|
|
1099
1141
|
return this.loadScript('FronteggAdminPortal');
|
|
1100
1142
|
case 2:
|
|
1101
|
-
FronteggAdminPortal =
|
|
1143
|
+
FronteggAdminPortal = _context18.sent;
|
|
1102
1144
|
this.checkoutDialogRenderer = FronteggAdminPortal.renderCheckoutDialog(this.checkoutDialogEl, Object.assign({
|
|
1103
1145
|
injector: this
|
|
1104
1146
|
}, opts, {
|
|
@@ -1106,11 +1148,11 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1106
1148
|
}));
|
|
1107
1149
|
case 4:
|
|
1108
1150
|
case "end":
|
|
1109
|
-
return
|
|
1151
|
+
return _context18.stop();
|
|
1110
1152
|
}
|
|
1111
|
-
},
|
|
1153
|
+
}, _callee18, this);
|
|
1112
1154
|
}));
|
|
1113
|
-
function showCheckoutDialog(
|
|
1155
|
+
function showCheckoutDialog(_x28) {
|
|
1114
1156
|
return _showCheckoutDialog.apply(this, arguments);
|
|
1115
1157
|
}
|
|
1116
1158
|
return showCheckoutDialog;
|
|
@@ -1199,9 +1241,9 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1199
1241
|
key: "stepUp",
|
|
1200
1242
|
value: function stepUp(options) {
|
|
1201
1243
|
var state = this.store.getState();
|
|
1202
|
-
var
|
|
1203
|
-
hostedLoginBox =
|
|
1204
|
-
stepUpUrl =
|
|
1244
|
+
var _ref16 = (state == null ? void 0 : state.auth) || {},
|
|
1245
|
+
hostedLoginBox = _ref16.hostedLoginBox,
|
|
1246
|
+
stepUpUrl = _ref16.routes.stepUpUrl;
|
|
1205
1247
|
if (hostedLoginBox) {
|
|
1206
1248
|
this.store.dispatch({
|
|
1207
1249
|
type: 'auth/stepUpHostedLogin',
|
|
@@ -1221,8 +1263,8 @@ var FronteggApp = /*#__PURE__*/function () {
|
|
|
1221
1263
|
value: function isSteppedUp() {
|
|
1222
1264
|
var _this$store$getState;
|
|
1223
1265
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1224
|
-
var
|
|
1225
|
-
user =
|
|
1266
|
+
var _ref17 = ((_this$store$getState = this.store.getState()) == null ? void 0 : _this$store$getState.auth) || {},
|
|
1267
|
+
user = _ref17.user;
|
|
1226
1268
|
return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_23__.isSteppedUp)(user, options);
|
|
1227
1269
|
}
|
|
1228
1270
|
|
|
@@ -1881,7 +1923,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1881
1923
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
1882
1924
|
/* harmony export */ });
|
|
1883
1925
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
1884
|
-
cdnVersion: '7.103.0
|
|
1926
|
+
cdnVersion: '7.103.0'
|
|
1885
1927
|
});
|
|
1886
1928
|
|
|
1887
1929
|
/***/ }),
|
|
@@ -2826,7 +2868,7 @@ const _excluded = ["user"],
|
|
|
2826
2868
|
preserveQueryParams: true
|
|
2827
2869
|
});
|
|
2828
2870
|
} else {
|
|
2829
|
-
var _events$userVerified;
|
|
2871
|
+
var _user$createdAt, _events$userVerified, _user$createdAt2;
|
|
2830
2872
|
setActivateState({
|
|
2831
2873
|
step: _interfaces__WEBPACK_IMPORTED_MODULE_4__.ActivateAccountStep.success
|
|
2832
2874
|
});
|
|
@@ -2836,10 +2878,19 @@ const _excluded = ["user"],
|
|
|
2836
2878
|
id: user.id,
|
|
2837
2879
|
tenantId: user.tenantId,
|
|
2838
2880
|
name: user.name,
|
|
2839
|
-
createdAt: new Date()
|
|
2881
|
+
createdAt: (_user$createdAt = user == null ? void 0 : user.createdAt) != null ? _user$createdAt : new Date()
|
|
2840
2882
|
};
|
|
2841
2883
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
2842
2884
|
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_8__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_8__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
2885
|
+
const loginCompletedPayload = {
|
|
2886
|
+
tenantId: user.tenantId,
|
|
2887
|
+
userId: user.id,
|
|
2888
|
+
authenticationType: 'activation_link',
|
|
2889
|
+
createdAt: (_user$createdAt2 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt2 : new Date(),
|
|
2890
|
+
email: user.email,
|
|
2891
|
+
name: user.name
|
|
2892
|
+
};
|
|
2893
|
+
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_8__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_8__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
2843
2894
|
actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
|
|
2844
2895
|
user
|
|
2845
2896
|
}, rest), {
|
|
@@ -5595,12 +5646,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5595
5646
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
|
|
5596
5647
|
/* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
|
|
5597
5648
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
|
|
5649
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
5598
5650
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
5599
5651
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
5600
5652
|
|
|
5601
5653
|
|
|
5602
5654
|
|
|
5603
5655
|
|
|
5656
|
+
|
|
5604
5657
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(store, api, sharedActions) {
|
|
5605
5658
|
const actions = sharedActions;
|
|
5606
5659
|
|
|
@@ -5694,6 +5747,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5694
5747
|
actions.setAuthState({
|
|
5695
5748
|
isAuthenticated
|
|
5696
5749
|
});
|
|
5750
|
+
if (isAuthenticated && !isStepUp) {
|
|
5751
|
+
const loginCompletedPayload = {
|
|
5752
|
+
tenantId: user.tenantId,
|
|
5753
|
+
userId: user.id,
|
|
5754
|
+
authenticationType: 'mfa',
|
|
5755
|
+
createdAt: new Date(),
|
|
5756
|
+
email: user.email,
|
|
5757
|
+
name: user.name
|
|
5758
|
+
};
|
|
5759
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_5__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
5760
|
+
}
|
|
5697
5761
|
if (isStepUp) {
|
|
5698
5762
|
return await postHandleVerifyMFAResponseForStepUp();
|
|
5699
5763
|
}
|
|
@@ -5722,10 +5786,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5722
5786
|
/* harmony export */ });
|
|
5723
5787
|
/* 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");
|
|
5724
5788
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/random.js");
|
|
5789
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
5725
5790
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants */ "../../dist/@frontegg/redux-store/constants.js");
|
|
5726
5791
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
5727
5792
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
5728
|
-
/* harmony import */ var
|
|
5793
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/StepUpState/helpers.js");
|
|
5729
5794
|
/* harmony import */ var _StepUpState_consts__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../StepUpState/consts */ "../../dist/@frontegg/redux-store/auth/StepUpState/consts.js");
|
|
5730
5795
|
|
|
5731
5796
|
|
|
@@ -5898,12 +5963,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5898
5963
|
code_verifier,
|
|
5899
5964
|
grant_type: 'authorization_code'
|
|
5900
5965
|
};
|
|
5966
|
+
const isStepUpFlow = window.localStorage.getItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_5__.SHOULD_STEP_UP_KEY);
|
|
5901
5967
|
try {
|
|
5902
5968
|
const response = await api.auth.exchangeOAuthTokensV2(body);
|
|
5969
|
+
const user = response.user;
|
|
5903
5970
|
actions.afterAuthenticationStateUpdate(response, {
|
|
5904
5971
|
isAuthenticated: true,
|
|
5905
5972
|
isLoading: false
|
|
5906
5973
|
});
|
|
5974
|
+
if (!isStepUpFlow) {
|
|
5975
|
+
const loginCompletedPayload = {
|
|
5976
|
+
tenantId: user == null ? void 0 : user.tenantId,
|
|
5977
|
+
userId: user == null ? void 0 : user.id,
|
|
5978
|
+
authenticationType: 'hosted',
|
|
5979
|
+
createdAt: user == null ? void 0 : user.createdAt,
|
|
5980
|
+
email: user == null ? void 0 : user.email,
|
|
5981
|
+
name: user == null ? void 0 : user.name
|
|
5982
|
+
};
|
|
5983
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
5984
|
+
}
|
|
5907
5985
|
} catch (e) {
|
|
5908
5986
|
actions.setAuthState({
|
|
5909
5987
|
isLoading: false
|
|
@@ -5911,11 +5989,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5911
5989
|
console.error('Failed to exchangeOAuthTokens', e);
|
|
5912
5990
|
} finally {
|
|
5913
5991
|
const user = store.auth.user;
|
|
5914
|
-
const isStepUpFlow = window.localStorage.getItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_5__.SHOULD_STEP_UP_KEY);
|
|
5915
5992
|
window.localStorage.removeItem(_StepUpState_consts__WEBPACK_IMPORTED_MODULE_5__.SHOULD_STEP_UP_KEY);
|
|
5916
5993
|
|
|
5917
5994
|
// when the user pause the step up flow we may still have the key in the local storage in hosted. Ignore it.
|
|
5918
|
-
if (isStepUpFlow && (0,
|
|
5995
|
+
if (isStepUpFlow && (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.isSteppedUp)(user)) {
|
|
5919
5996
|
await actions.afterStepUpAuthNavigation();
|
|
5920
5997
|
} else {
|
|
5921
5998
|
await actions.afterAuthNavigation();
|
|
@@ -5956,7 +6033,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5956
6033
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
|
|
5957
6034
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
5958
6035
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
|
|
5959
|
-
/* harmony import */ var
|
|
6036
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
5960
6037
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
|
|
5961
6038
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
|
|
5962
6039
|
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../state */ "../../dist/@frontegg/redux-store/auth/LoginState/state.js");
|
|
@@ -5964,13 +6041,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5964
6041
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/ContextHolder/index.js");
|
|
5965
6042
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/feature-flags/index.js");
|
|
5966
6043
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/enums.js");
|
|
5967
|
-
/* harmony import */ var
|
|
6044
|
+
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/utils.js");
|
|
5968
6045
|
/* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @frontegg/rest-api */ "../../dist/@frontegg/rest-api/auth/interfaces.js");
|
|
5969
6046
|
/* harmony import */ var _hostedLoginAuthorize_actions__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./hostedLoginAuthorize.actions */ "../../dist/@frontegg/redux-store/auth/LoginState/actions/hostedLoginAuthorize.actions.js");
|
|
5970
6047
|
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/auth/Entitlements/helpers.js");
|
|
5971
6048
|
/* harmony import */ var _toolkit__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../toolkit */ "../../dist/@frontegg/redux-store/toolkit/FronteggNativeModule.js");
|
|
5972
6049
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../interfaces */ "../../dist/@frontegg/redux-store/auth/interfaces.js");
|
|
5973
|
-
/* harmony import */ var
|
|
6050
|
+
/* harmony import */ var _consts__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../consts */ "../../dist/@frontegg/redux-store/auth/LoginState/consts.js");
|
|
5974
6051
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
5975
6052
|
/* harmony import */ var _MfaState_interfaces__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../../MfaState/interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
|
|
5976
6053
|
/* harmony import */ var _SSOState_interfaces__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../SSOState/interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
|
|
@@ -6412,10 +6489,23 @@ const _excluded = ["callback", "error"],
|
|
|
6412
6489
|
});
|
|
6413
6490
|
try {
|
|
6414
6491
|
const user = await api.auth.postLogin(payload);
|
|
6492
|
+
const isAuthenticated = !!user.accessToken;
|
|
6415
6493
|
actions.setAuthState({
|
|
6416
6494
|
user: user.accessToken ? user : undefined,
|
|
6417
|
-
isAuthenticated
|
|
6495
|
+
isAuthenticated
|
|
6418
6496
|
});
|
|
6497
|
+
if (isAuthenticated) {
|
|
6498
|
+
var _user$createdAt;
|
|
6499
|
+
const loginCompletedPayload = {
|
|
6500
|
+
tenantId: user.tenantId,
|
|
6501
|
+
userId: user.id,
|
|
6502
|
+
authenticationType: 'password',
|
|
6503
|
+
createdAt: (_user$createdAt = user == null ? void 0 : user.createdAt) != null ? _user$createdAt : new Date(),
|
|
6504
|
+
email: user.email,
|
|
6505
|
+
name: user.name
|
|
6506
|
+
};
|
|
6507
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6508
|
+
}
|
|
6419
6509
|
await actions.afterAuthNavigation();
|
|
6420
6510
|
} catch (e) {
|
|
6421
6511
|
setTimeout(() => {
|
|
@@ -6497,6 +6587,18 @@ const _excluded = ["callback", "error"],
|
|
|
6497
6587
|
},
|
|
6498
6588
|
isAuthenticated
|
|
6499
6589
|
});
|
|
6590
|
+
if (isAuthenticated) {
|
|
6591
|
+
var _user$createdAt2;
|
|
6592
|
+
const loginCompletedPayload = {
|
|
6593
|
+
tenantId: user.tenantId,
|
|
6594
|
+
userId: user.id,
|
|
6595
|
+
authenticationType: 'password',
|
|
6596
|
+
createdAt: (_user$createdAt2 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt2 : new Date(),
|
|
6597
|
+
email,
|
|
6598
|
+
name: user.name
|
|
6599
|
+
};
|
|
6600
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6601
|
+
}
|
|
6500
6602
|
if (loginState.flow === _interfaces__WEBPACK_IMPORTED_MODULE_4__.LoginFlow.Login) {
|
|
6501
6603
|
if (securityCenterLoginFlows && user.isBreachedPassword && !isAuthenticated) {
|
|
6502
6604
|
setLoginState({
|
|
@@ -6563,7 +6665,7 @@ const _excluded = ["callback", "error"],
|
|
|
6563
6665
|
/* empty */
|
|
6564
6666
|
}
|
|
6565
6667
|
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
6566
|
-
(0,
|
|
6668
|
+
(0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
|
|
6567
6669
|
}
|
|
6568
6670
|
actions.resetAuthState();
|
|
6569
6671
|
await actions.requestAuthorize(true);
|
|
@@ -6577,7 +6679,7 @@ const _excluded = ["callback", "error"],
|
|
|
6577
6679
|
/* empty */
|
|
6578
6680
|
}
|
|
6579
6681
|
if (contextHolder.isSessionPerTenantEnabled()) {
|
|
6580
|
-
(0,
|
|
6682
|
+
(0,_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.removeTabTenantFromSessionStorage)();
|
|
6581
6683
|
}
|
|
6582
6684
|
setTimeout(() => {
|
|
6583
6685
|
var _payload$callback3;
|
|
@@ -6711,7 +6813,7 @@ const _excluded = ["callback", "error"],
|
|
|
6711
6813
|
username: (_username = username) != null ? _username : ''
|
|
6712
6814
|
}));
|
|
6713
6815
|
// @ts-ignore
|
|
6714
|
-
const step =
|
|
6816
|
+
const step = _consts__WEBPACK_IMPORTED_MODULE_18__.authStrategyLoginStepMap[payload.type];
|
|
6715
6817
|
setLoginState({
|
|
6716
6818
|
step,
|
|
6717
6819
|
loading: false,
|
|
@@ -6754,6 +6856,7 @@ const _excluded = ["callback", "error"],
|
|
|
6754
6856
|
preserveQueryParams: true
|
|
6755
6857
|
});
|
|
6756
6858
|
} else {
|
|
6859
|
+
var _user$createdAt3;
|
|
6757
6860
|
const loginState = store.auth.loginState;
|
|
6758
6861
|
if (user.emailVerified) {
|
|
6759
6862
|
var _events$userVerified;
|
|
@@ -6766,8 +6869,17 @@ const _excluded = ["callback", "error"],
|
|
|
6766
6869
|
name: user.name
|
|
6767
6870
|
};
|
|
6768
6871
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
6769
|
-
(0,
|
|
6872
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
6770
6873
|
}
|
|
6874
|
+
const loginCompletedPayload = {
|
|
6875
|
+
tenantId: user.tenantId,
|
|
6876
|
+
userId: user.id,
|
|
6877
|
+
authenticationType: 'magic_link',
|
|
6878
|
+
createdAt: (_user$createdAt3 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt3 : new Date(),
|
|
6879
|
+
email: user.email,
|
|
6880
|
+
name: user.name
|
|
6881
|
+
};
|
|
6882
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6771
6883
|
if (user.id) {
|
|
6772
6884
|
localStorage.setItem('userId', user.id);
|
|
6773
6885
|
}
|
|
@@ -6923,6 +7035,7 @@ const _excluded = ["callback", "error"],
|
|
|
6923
7035
|
preserveQueryParams: true
|
|
6924
7036
|
});
|
|
6925
7037
|
} else {
|
|
7038
|
+
var _user$createdAt4;
|
|
6926
7039
|
if (user.id) {
|
|
6927
7040
|
localStorage.setItem('userId', user.id);
|
|
6928
7041
|
}
|
|
@@ -6934,6 +7047,15 @@ const _excluded = ["callback", "error"],
|
|
|
6934
7047
|
setLoginState({
|
|
6935
7048
|
error: undefined
|
|
6936
7049
|
});
|
|
7050
|
+
const loginCompletedPayload = {
|
|
7051
|
+
tenantId: user.tenantId,
|
|
7052
|
+
userId: user.id,
|
|
7053
|
+
authenticationType: 'webauthn',
|
|
7054
|
+
createdAt: (_user$createdAt4 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt4 : new Date(),
|
|
7055
|
+
email: user.email,
|
|
7056
|
+
name: user.name
|
|
7057
|
+
};
|
|
7058
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6937
7059
|
await actions.afterAuthNavigation();
|
|
6938
7060
|
// TODO: Itamar why moving callback to inside the else block
|
|
6939
7061
|
callback == null ? void 0 : callback(true);
|
|
@@ -7485,7 +7607,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7485
7607
|
/* 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");
|
|
7486
7608
|
/* 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");
|
|
7487
7609
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../interfaces */ "../../dist/@frontegg/redux-store/auth/LoginState/interfaces.js");
|
|
7488
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/
|
|
7610
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
7611
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
|
|
7489
7612
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
7490
7613
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
7491
7614
|
|
|
@@ -7610,6 +7733,17 @@ const _excluded = ["callback"];
|
|
|
7610
7733
|
tenants,
|
|
7611
7734
|
activeTenant
|
|
7612
7735
|
}, additionalUpdate);
|
|
7736
|
+
if (isAuthenticated && !isStepUp) {
|
|
7737
|
+
const loginCompletedPayload = {
|
|
7738
|
+
tenantId: user.tenantId,
|
|
7739
|
+
userId: user.id,
|
|
7740
|
+
authenticationType: 'mfa',
|
|
7741
|
+
createdAt: new Date(),
|
|
7742
|
+
email: user.email,
|
|
7743
|
+
name: user.name
|
|
7744
|
+
};
|
|
7745
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_5__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
7746
|
+
}
|
|
7613
7747
|
if (user.id) {
|
|
7614
7748
|
localStorage.setItem('userId', user.id);
|
|
7615
7749
|
}
|
|
@@ -7624,7 +7758,7 @@ const _excluded = ["callback"];
|
|
|
7624
7758
|
} catch (e) {
|
|
7625
7759
|
setLoadingAction({
|
|
7626
7760
|
loading: false,
|
|
7627
|
-
error: (0,
|
|
7761
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.errorHandler)(e)
|
|
7628
7762
|
});
|
|
7629
7763
|
callback == null ? void 0 : callback(false, e);
|
|
7630
7764
|
}
|
|
@@ -9874,8 +10008,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9874
10008
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
|
|
9875
10009
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
9876
10010
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
|
|
9877
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/
|
|
9878
|
-
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/
|
|
10011
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
10012
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
|
|
10013
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
|
|
9879
10014
|
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state */ "../../dist/@frontegg/redux-store/auth/MfaState/state.js");
|
|
9880
10015
|
|
|
9881
10016
|
|
|
@@ -10032,6 +10167,18 @@ const _excluded = ["callback"],
|
|
|
10032
10167
|
await actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
|
|
10033
10168
|
user
|
|
10034
10169
|
}, rest));
|
|
10170
|
+
if (!!(user != null && user.accessToken)) {
|
|
10171
|
+
var _user$createdAt;
|
|
10172
|
+
const loginCompletedPayload = {
|
|
10173
|
+
tenantId: user == null ? void 0 : user.tenantId,
|
|
10174
|
+
userId: user == null ? void 0 : user.id,
|
|
10175
|
+
authenticationType: 'mfa',
|
|
10176
|
+
createdAt: (_user$createdAt = user == null ? void 0 : user.createdAt) != null ? _user$createdAt : new Date(),
|
|
10177
|
+
email: user == null ? void 0 : user.email,
|
|
10178
|
+
name: user == null ? void 0 : user.name
|
|
10179
|
+
};
|
|
10180
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
10181
|
+
}
|
|
10035
10182
|
callback == null ? void 0 : callback(mfaState.recoveryCode);
|
|
10036
10183
|
} catch (e) {
|
|
10037
10184
|
setMfaState({
|
|
@@ -10174,12 +10321,12 @@ const _excluded = ["callback"],
|
|
|
10174
10321
|
var _data$options$exclude, _payload$callback9;
|
|
10175
10322
|
const data = await api.auth.preEnrollMFAWebAuthn();
|
|
10176
10323
|
const options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options, {
|
|
10177
|
-
challenge: (0,
|
|
10324
|
+
challenge: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.challenge),
|
|
10178
10325
|
user: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options.user, {
|
|
10179
|
-
id: (0,
|
|
10326
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.user.id)
|
|
10180
10327
|
}),
|
|
10181
10328
|
excludeCredentials: (_data$options$exclude = data.options.excludeCredentials) == null ? void 0 : _data$options$exclude.map(credentials => (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, credentials, {
|
|
10182
|
-
id: (0,
|
|
10329
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(credentials.id)
|
|
10183
10330
|
}))
|
|
10184
10331
|
});
|
|
10185
10332
|
setMfaState({
|
|
@@ -10207,7 +10354,7 @@ const _excluded = ["callback"],
|
|
|
10207
10354
|
saving: true
|
|
10208
10355
|
});
|
|
10209
10356
|
try {
|
|
10210
|
-
const publicKey = (0,
|
|
10357
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.publicKeyCredentialToJSON)(payload.publicKey);
|
|
10211
10358
|
|
|
10212
10359
|
// @ts-ignore // TODO: fix enrollMFAWebAuthn in rest-api
|
|
10213
10360
|
const data = await api.auth.enrollMFAWebAuthn((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, payload, {
|
|
@@ -10239,9 +10386,9 @@ const _excluded = ["callback"],
|
|
|
10239
10386
|
var _data$options$allowCr;
|
|
10240
10387
|
const data = await api.auth.preDisableMFAWebAuthn(deviceId);
|
|
10241
10388
|
const options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options, {
|
|
10242
|
-
challenge: (0,
|
|
10389
|
+
challenge: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.challenge),
|
|
10243
10390
|
allowCredentials: (_data$options$allowCr = data.options.allowCredentials) == null ? void 0 : _data$options$allowCr.map(credentials => (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, credentials, {
|
|
10244
|
-
id: (0,
|
|
10391
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(credentials.id)
|
|
10245
10392
|
}))
|
|
10246
10393
|
});
|
|
10247
10394
|
setMfaState({
|
|
@@ -10269,7 +10416,7 @@ const _excluded = ["callback"],
|
|
|
10269
10416
|
saving: true
|
|
10270
10417
|
});
|
|
10271
10418
|
try {
|
|
10272
|
-
const publicKey = (0,
|
|
10419
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.publicKeyCredentialToJSON)(payload.publicKey);
|
|
10273
10420
|
await api.auth.disableMFAWebAuthn(deviceId, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, payload, {
|
|
10274
10421
|
options: publicKey
|
|
10275
10422
|
}));
|
|
@@ -14934,6 +15081,7 @@ const _excluded = ["authorizationUrl"],
|
|
|
14934
15081
|
tenantId
|
|
14935
15082
|
};
|
|
14936
15083
|
const signUpCompletePayload = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, basePayload, {
|
|
15084
|
+
name,
|
|
14937
15085
|
socialProvider: payload.provider,
|
|
14938
15086
|
authenticationType: _interfaces__WEBPACK_IMPORTED_MODULE_5__.AuthenticationTypes.SOCIAL_LOGIN
|
|
14939
15087
|
});
|
|
@@ -14946,6 +15094,17 @@ const _excluded = ["authorizationUrl"],
|
|
|
14946
15094
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
14947
15095
|
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
14948
15096
|
}
|
|
15097
|
+
const loginCompletedPayload = {
|
|
15098
|
+
tenantId,
|
|
15099
|
+
userId,
|
|
15100
|
+
authenticationType: _interfaces__WEBPACK_IMPORTED_MODULE_5__.AuthenticationTypes.SOCIAL_LOGIN,
|
|
15101
|
+
createdAt: new Date(),
|
|
15102
|
+
provider: payload.provider,
|
|
15103
|
+
email,
|
|
15104
|
+
name,
|
|
15105
|
+
isFirstLogin: isNewUser
|
|
15106
|
+
};
|
|
15107
|
+
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
14949
15108
|
if (userId) {
|
|
14950
15109
|
localStorage.setItem('userId', userId);
|
|
14951
15110
|
}
|
|
@@ -19126,6 +19285,7 @@ let GTMEventAction;
|
|
|
19126
19285
|
(function (GTMEventAction) {
|
|
19127
19286
|
GTMEventAction["SIGNUP_COMPLETED"] = "signup_completed";
|
|
19128
19287
|
GTMEventAction["USER_VERIFIED"] = "user_verified";
|
|
19288
|
+
GTMEventAction["LOGIN_COMPLETED"] = "login_completed";
|
|
19129
19289
|
})(GTMEventAction || (GTMEventAction = {}));
|
|
19130
19290
|
/**
|
|
19131
19291
|
* Report GTM event by onFronteggEvent
|
|
@@ -19853,7 +20013,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19853
20013
|
/* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
|
|
19854
20014
|
/* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
|
|
19855
20015
|
/* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
|
|
19856
|
-
/** @license Frontegg v7.103.0
|
|
20016
|
+
/** @license Frontegg v7.103.0
|
|
19857
20017
|
*
|
|
19858
20018
|
* This source code is licensed under the MIT license found in the
|
|
19859
20019
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30214,7 +30374,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30214
30374
|
/* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
|
|
30215
30375
|
/* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
|
|
30216
30376
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
|
|
30217
|
-
/** @license Frontegg v7.103.0
|
|
30377
|
+
/** @license Frontegg v7.103.0
|
|
30218
30378
|
*
|
|
30219
30379
|
* This source code is licensed under the MIT license found in the
|
|
30220
30380
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -33009,7 +33169,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33009
33169
|
/* harmony export */ });
|
|
33010
33170
|
/* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
|
|
33011
33171
|
/* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
|
|
33012
|
-
/** @license Frontegg v7.103.0
|
|
33172
|
+
/** @license Frontegg v7.103.0
|
|
33013
33173
|
*
|
|
33014
33174
|
* This source code is licensed under the MIT license found in the
|
|
33015
33175
|
* LICENSE file in the root directory of this source tree.
|