@frontegg/js 7.103.0-alpha.1 → 7.104.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +227 -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.
|
|
1926
|
+
cdnVersion: '7.104.0-alpha.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,12 +6813,13 @@ 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,
|
|
6718
6820
|
phoneNumber: preloginRes == null ? void 0 : preloginRes.phoneNumber,
|
|
6719
6821
|
email,
|
|
6822
|
+
username,
|
|
6720
6823
|
error: undefined
|
|
6721
6824
|
});
|
|
6722
6825
|
callback == null ? void 0 : callback();
|
|
@@ -6754,6 +6857,7 @@ const _excluded = ["callback", "error"],
|
|
|
6754
6857
|
preserveQueryParams: true
|
|
6755
6858
|
});
|
|
6756
6859
|
} else {
|
|
6860
|
+
var _user$createdAt3;
|
|
6757
6861
|
const loginState = store.auth.loginState;
|
|
6758
6862
|
if (user.emailVerified) {
|
|
6759
6863
|
var _events$userVerified;
|
|
@@ -6766,8 +6870,17 @@ const _excluded = ["callback", "error"],
|
|
|
6766
6870
|
name: user.name
|
|
6767
6871
|
};
|
|
6768
6872
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
6769
|
-
(0,
|
|
6873
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
6770
6874
|
}
|
|
6875
|
+
const loginCompletedPayload = {
|
|
6876
|
+
tenantId: user.tenantId,
|
|
6877
|
+
userId: user.id,
|
|
6878
|
+
authenticationType: 'magic_link',
|
|
6879
|
+
createdAt: (_user$createdAt3 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt3 : new Date(),
|
|
6880
|
+
email: user.email,
|
|
6881
|
+
name: user.name
|
|
6882
|
+
};
|
|
6883
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6771
6884
|
if (user.id) {
|
|
6772
6885
|
localStorage.setItem('userId', user.id);
|
|
6773
6886
|
}
|
|
@@ -6923,6 +7036,7 @@ const _excluded = ["callback", "error"],
|
|
|
6923
7036
|
preserveQueryParams: true
|
|
6924
7037
|
});
|
|
6925
7038
|
} else {
|
|
7039
|
+
var _user$createdAt4;
|
|
6926
7040
|
if (user.id) {
|
|
6927
7041
|
localStorage.setItem('userId', user.id);
|
|
6928
7042
|
}
|
|
@@ -6934,6 +7048,15 @@ const _excluded = ["callback", "error"],
|
|
|
6934
7048
|
setLoginState({
|
|
6935
7049
|
error: undefined
|
|
6936
7050
|
});
|
|
7051
|
+
const loginCompletedPayload = {
|
|
7052
|
+
tenantId: user.tenantId,
|
|
7053
|
+
userId: user.id,
|
|
7054
|
+
authenticationType: 'webauthn',
|
|
7055
|
+
createdAt: (_user$createdAt4 = user == null ? void 0 : user.createdAt) != null ? _user$createdAt4 : new Date(),
|
|
7056
|
+
email: user.email,
|
|
7057
|
+
name: user.name
|
|
7058
|
+
};
|
|
7059
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_16__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_16__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
6937
7060
|
await actions.afterAuthNavigation();
|
|
6938
7061
|
// TODO: Itamar why moving callback to inside the else block
|
|
6939
7062
|
callback == null ? void 0 : callback(true);
|
|
@@ -7485,7 +7608,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7485
7608
|
/* 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
7609
|
/* 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
7610
|
/* 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/
|
|
7611
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
7612
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../helpers */ "../../dist/@frontegg/redux-store/helpers/handlers.js");
|
|
7489
7613
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/helpers.js");
|
|
7490
7614
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/auth/LoginState/helpers.js");
|
|
7491
7615
|
|
|
@@ -7610,6 +7734,17 @@ const _excluded = ["callback"];
|
|
|
7610
7734
|
tenants,
|
|
7611
7735
|
activeTenant
|
|
7612
7736
|
}, additionalUpdate);
|
|
7737
|
+
if (isAuthenticated && !isStepUp) {
|
|
7738
|
+
const loginCompletedPayload = {
|
|
7739
|
+
tenantId: user.tenantId,
|
|
7740
|
+
userId: user.id,
|
|
7741
|
+
authenticationType: 'mfa',
|
|
7742
|
+
createdAt: new Date(),
|
|
7743
|
+
email: user.email,
|
|
7744
|
+
name: user.name
|
|
7745
|
+
};
|
|
7746
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_5__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_5__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
7747
|
+
}
|
|
7613
7748
|
if (user.id) {
|
|
7614
7749
|
localStorage.setItem('userId', user.id);
|
|
7615
7750
|
}
|
|
@@ -7624,7 +7759,7 @@ const _excluded = ["callback"];
|
|
|
7624
7759
|
} catch (e) {
|
|
7625
7760
|
setLoadingAction({
|
|
7626
7761
|
loading: false,
|
|
7627
|
-
error: (0,
|
|
7762
|
+
error: (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.errorHandler)(e)
|
|
7628
7763
|
});
|
|
7629
7764
|
callback == null ? void 0 : callback(false, e);
|
|
7630
7765
|
}
|
|
@@ -9874,8 +10009,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9874
10009
|
/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interfaces */ "../../dist/@frontegg/redux-store/auth/MfaState/interfaces.js");
|
|
9875
10010
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/common.js");
|
|
9876
10011
|
/* 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/
|
|
10012
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/gtm.js");
|
|
10013
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/encoders.js");
|
|
10014
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers/converters.js");
|
|
9879
10015
|
/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./state */ "../../dist/@frontegg/redux-store/auth/MfaState/state.js");
|
|
9880
10016
|
|
|
9881
10017
|
|
|
@@ -10032,6 +10168,18 @@ const _excluded = ["callback"],
|
|
|
10032
10168
|
await actions.afterAuthenticationStateUpdate((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
|
|
10033
10169
|
user
|
|
10034
10170
|
}, rest));
|
|
10171
|
+
if (!!(user != null && user.accessToken)) {
|
|
10172
|
+
var _user$createdAt;
|
|
10173
|
+
const loginCompletedPayload = {
|
|
10174
|
+
tenantId: user == null ? void 0 : user.tenantId,
|
|
10175
|
+
userId: user == null ? void 0 : user.id,
|
|
10176
|
+
authenticationType: 'mfa',
|
|
10177
|
+
createdAt: (_user$createdAt = user == null ? void 0 : user.createdAt) != null ? _user$createdAt : new Date(),
|
|
10178
|
+
email: user == null ? void 0 : user.email,
|
|
10179
|
+
name: user == null ? void 0 : user.name
|
|
10180
|
+
};
|
|
10181
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
10182
|
+
}
|
|
10035
10183
|
callback == null ? void 0 : callback(mfaState.recoveryCode);
|
|
10036
10184
|
} catch (e) {
|
|
10037
10185
|
setMfaState({
|
|
@@ -10174,12 +10322,12 @@ const _excluded = ["callback"],
|
|
|
10174
10322
|
var _data$options$exclude, _payload$callback9;
|
|
10175
10323
|
const data = await api.auth.preEnrollMFAWebAuthn();
|
|
10176
10324
|
const options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options, {
|
|
10177
|
-
challenge: (0,
|
|
10325
|
+
challenge: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.challenge),
|
|
10178
10326
|
user: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options.user, {
|
|
10179
|
-
id: (0,
|
|
10327
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.user.id)
|
|
10180
10328
|
}),
|
|
10181
10329
|
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,
|
|
10330
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(credentials.id)
|
|
10183
10331
|
}))
|
|
10184
10332
|
});
|
|
10185
10333
|
setMfaState({
|
|
@@ -10207,7 +10355,7 @@ const _excluded = ["callback"],
|
|
|
10207
10355
|
saving: true
|
|
10208
10356
|
});
|
|
10209
10357
|
try {
|
|
10210
|
-
const publicKey = (0,
|
|
10358
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.publicKeyCredentialToJSON)(payload.publicKey);
|
|
10211
10359
|
|
|
10212
10360
|
// @ts-ignore // TODO: fix enrollMFAWebAuthn in rest-api
|
|
10213
10361
|
const data = await api.auth.enrollMFAWebAuthn((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, payload, {
|
|
@@ -10239,9 +10387,9 @@ const _excluded = ["callback"],
|
|
|
10239
10387
|
var _data$options$allowCr;
|
|
10240
10388
|
const data = await api.auth.preDisableMFAWebAuthn(deviceId);
|
|
10241
10389
|
const options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, data.options, {
|
|
10242
|
-
challenge: (0,
|
|
10390
|
+
challenge: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(data.options.challenge),
|
|
10243
10391
|
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,
|
|
10392
|
+
id: (0,_helpers__WEBPACK_IMPORTED_MODULE_7__.base64urlDecode)(credentials.id)
|
|
10245
10393
|
}))
|
|
10246
10394
|
});
|
|
10247
10395
|
setMfaState({
|
|
@@ -10269,7 +10417,7 @@ const _excluded = ["callback"],
|
|
|
10269
10417
|
saving: true
|
|
10270
10418
|
});
|
|
10271
10419
|
try {
|
|
10272
|
-
const publicKey = (0,
|
|
10420
|
+
const publicKey = (0,_helpers__WEBPACK_IMPORTED_MODULE_8__.publicKeyCredentialToJSON)(payload.publicKey);
|
|
10273
10421
|
await api.auth.disableMFAWebAuthn(deviceId, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, payload, {
|
|
10274
10422
|
options: publicKey
|
|
10275
10423
|
}));
|
|
@@ -14934,6 +15082,7 @@ const _excluded = ["authorizationUrl"],
|
|
|
14934
15082
|
tenantId
|
|
14935
15083
|
};
|
|
14936
15084
|
const signUpCompletePayload = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, basePayload, {
|
|
15085
|
+
name,
|
|
14937
15086
|
socialProvider: payload.provider,
|
|
14938
15087
|
authenticationType: _interfaces__WEBPACK_IMPORTED_MODULE_5__.AuthenticationTypes.SOCIAL_LOGIN
|
|
14939
15088
|
});
|
|
@@ -14946,6 +15095,17 @@ const _excluded = ["authorizationUrl"],
|
|
|
14946
15095
|
events == null ? void 0 : (_events$userVerified = events.userVerified) == null ? void 0 : _events$userVerified.call(events, userVerifiedPayload);
|
|
14947
15096
|
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.USER_VERIFIED, userVerifiedPayload);
|
|
14948
15097
|
}
|
|
15098
|
+
const loginCompletedPayload = {
|
|
15099
|
+
tenantId,
|
|
15100
|
+
userId,
|
|
15101
|
+
authenticationType: _interfaces__WEBPACK_IMPORTED_MODULE_5__.AuthenticationTypes.SOCIAL_LOGIN,
|
|
15102
|
+
createdAt: new Date(),
|
|
15103
|
+
provider: payload.provider,
|
|
15104
|
+
email,
|
|
15105
|
+
name,
|
|
15106
|
+
isFirstLogin: isNewUser
|
|
15107
|
+
};
|
|
15108
|
+
(0,_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.reportGTMEvent)(_helpers_gtm__WEBPACK_IMPORTED_MODULE_6__.GTMEventAction.LOGIN_COMPLETED, loginCompletedPayload);
|
|
14949
15109
|
if (userId) {
|
|
14950
15110
|
localStorage.setItem('userId', userId);
|
|
14951
15111
|
}
|
|
@@ -19126,6 +19286,7 @@ let GTMEventAction;
|
|
|
19126
19286
|
(function (GTMEventAction) {
|
|
19127
19287
|
GTMEventAction["SIGNUP_COMPLETED"] = "signup_completed";
|
|
19128
19288
|
GTMEventAction["USER_VERIFIED"] = "user_verified";
|
|
19289
|
+
GTMEventAction["LOGIN_COMPLETED"] = "login_completed";
|
|
19129
19290
|
})(GTMEventAction || (GTMEventAction = {}));
|
|
19130
19291
|
/**
|
|
19131
19292
|
* Report GTM event by onFronteggEvent
|
|
@@ -19853,7 +20014,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19853
20014
|
/* harmony import */ var _subscriptions_interfaces__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./subscriptions/interfaces */ "../../dist/@frontegg/redux-store/subscriptions/interfaces.js");
|
|
19854
20015
|
/* harmony import */ var _vendor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vendor */ "../../dist/@frontegg/redux-store/vendor/index.js");
|
|
19855
20016
|
/* harmony import */ var _audits__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./audits */ "../../dist/@frontegg/redux-store/audits/index.js");
|
|
19856
|
-
/** @license Frontegg v7.
|
|
20017
|
+
/** @license Frontegg v7.104.0-alpha.0
|
|
19857
20018
|
*
|
|
19858
20019
|
* This source code is licensed under the MIT license found in the
|
|
19859
20020
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30214,7 +30375,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30214
30375
|
/* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./security-center/interfaces */ "../../dist/@frontegg/rest-api/security-center/interfaces.js");
|
|
30215
30376
|
/* harmony import */ var _applications_interfaces__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./applications/interfaces */ "../../dist/@frontegg/rest-api/applications/interfaces.js");
|
|
30216
30377
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "../../dist/@frontegg/rest-api/constants.js");
|
|
30217
|
-
/** @license Frontegg v7.
|
|
30378
|
+
/** @license Frontegg v7.104.0-alpha.0
|
|
30218
30379
|
*
|
|
30219
30380
|
* This source code is licensed under the MIT license found in the
|
|
30220
30381
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -33009,7 +33170,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33009
33170
|
/* harmony export */ });
|
|
33010
33171
|
/* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
|
|
33011
33172
|
/* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
|
|
33012
|
-
/** @license Frontegg v7.
|
|
33173
|
+
/** @license Frontegg v7.104.0-alpha.0
|
|
33013
33174
|
*
|
|
33014
33175
|
* This source code is licensed under the MIT license found in the
|
|
33015
33176
|
* LICENSE file in the root directory of this source tree.
|