mario-core 2.9.98-beta → 2.9.101-beta
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/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +13 -4
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2675,12 +2675,14 @@ var apiUpload = axios.create({
|
|
|
2675
2675
|
if (!key.includes('learning-plan')) delete localStorage[key];
|
|
2676
2676
|
});
|
|
2677
2677
|
var userEmail = localStorage.getItem("USER_EMAIL");
|
|
2678
|
+
var roles = localStorage.getItem("ROLES");
|
|
2678
2679
|
var hostName = window.location.hostname;
|
|
2679
2680
|
|
|
2680
2681
|
if (userEmail) {
|
|
2681
2682
|
amplitude.getInstance().logEvent("general: session end", {
|
|
2682
2683
|
user_id: userEmail,
|
|
2683
|
-
domain: hostName
|
|
2684
|
+
domain: hostName,
|
|
2685
|
+
roles: roles
|
|
2684
2686
|
});
|
|
2685
2687
|
amplitude.getInstance().resetSessionId();
|
|
2686
2688
|
}
|
|
@@ -2824,6 +2826,8 @@ var useLogin = function useLogin() {
|
|
|
2824
2826
|
}));
|
|
2825
2827
|
|
|
2826
2828
|
if (data !== null && data !== void 0 && data.email && !roles.includes("Admin")) {
|
|
2829
|
+
var _data$roles;
|
|
2830
|
+
|
|
2827
2831
|
amplitude.getInstance().init(!isLocalhost ? INIT_AMPLITUDE_KEY_PROD : INIT_AMPLITUDE_KEY_STAGE, data.email, {
|
|
2828
2832
|
includeReferrer: false,
|
|
2829
2833
|
includeUtm: false
|
|
@@ -2831,14 +2835,18 @@ var useLogin = function useLogin() {
|
|
|
2831
2835
|
var hostName = window.location.hostname;
|
|
2832
2836
|
amplitude.getInstance().logEvent("general: session start", {
|
|
2833
2837
|
user_id: data.email,
|
|
2834
|
-
domain: hostName
|
|
2838
|
+
domain: hostName,
|
|
2839
|
+
roles: data === null || data === void 0 ? void 0 : (_data$roles = data.roles) === null || _data$roles === void 0 ? void 0 : _data$roles.toString()
|
|
2835
2840
|
});
|
|
2836
2841
|
localStorage.setItem("USER_EMAIL", data.email);
|
|
2837
2842
|
|
|
2838
2843
|
if (isLoginFirst) {
|
|
2844
|
+
var _data$roles2;
|
|
2845
|
+
|
|
2839
2846
|
amplitude.getInstance().logEvent("general: first login", {
|
|
2840
2847
|
user_id: data.email,
|
|
2841
|
-
domain: hostName
|
|
2848
|
+
domain: hostName,
|
|
2849
|
+
roles: data === null || data === void 0 ? void 0 : (_data$roles2 = data.roles) === null || _data$roles2 === void 0 ? void 0 : _data$roles2.toString()
|
|
2842
2850
|
});
|
|
2843
2851
|
}
|
|
2844
2852
|
}
|
|
@@ -9498,7 +9506,8 @@ var initialState = {
|
|
|
9498
9506
|
first_login: "",
|
|
9499
9507
|
duration_since: 0,
|
|
9500
9508
|
last_page: "",
|
|
9501
|
-
event: ""
|
|
9509
|
+
event: "",
|
|
9510
|
+
roles: ""
|
|
9502
9511
|
}
|
|
9503
9512
|
};
|
|
9504
9513
|
var commonReducer = toolkit.createReducer(initialState, function (builder) {
|