acsi-core 1.2.41 → 1.2.42
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/README.md +3 -46
- package/dist/index.js +30 -18
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +30 -18
- package/dist/index.modern.js.map +1 -1
- package/package.json +5 -2
package/dist/index.modern.js
CHANGED
|
@@ -159,6 +159,9 @@ function _catch(body, recover) {
|
|
|
159
159
|
return result;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
var _process$env$PUBLIC_U;
|
|
163
|
+
var PUBLIC_URL = (_process$env$PUBLIC_U = process.env.PUBLIC_URL) != null ? _process$env$PUBLIC_U : '';
|
|
164
|
+
|
|
162
165
|
var styles = {"core-button":"_xvNBN","primary":"_U9Qyp","secondary":"_1VzMy","text":"_pZNuj","danger":"_2uYm1","light":"_wxH5S"};
|
|
163
166
|
|
|
164
167
|
var _excluded = ["type", "children", "onClick", "icon", "disabled", "htmlType"];
|
|
@@ -1730,6 +1733,10 @@ var apiUpload = axios.create({
|
|
|
1730
1733
|
if (imPersonate) {
|
|
1731
1734
|
config.headers.ImPersonate = imPersonate;
|
|
1732
1735
|
}
|
|
1736
|
+
var tenantId = config.externalTenantId || localStorage.getItem(ORGANIZATION_TENANT);
|
|
1737
|
+
if (tenantId) {
|
|
1738
|
+
config.headers["X-TenantID"] = tenantId;
|
|
1739
|
+
}
|
|
1733
1740
|
return config;
|
|
1734
1741
|
}, function (error) {
|
|
1735
1742
|
return Promise.reject(error);
|
|
@@ -1761,14 +1768,15 @@ var apiUpload = axios.create({
|
|
|
1761
1768
|
});
|
|
1762
1769
|
});
|
|
1763
1770
|
|
|
1771
|
+
var IDP_URL = "" + process.env.REACT_APP_IDP_API_URL;
|
|
1764
1772
|
var apiLoginGoogle = function apiLoginGoogle(body) {
|
|
1765
|
-
return api.post(
|
|
1773
|
+
return api.post(IDP_URL + "/api/Auth/login", body);
|
|
1766
1774
|
};
|
|
1767
1775
|
var apiSendEmailCode = function apiSendEmailCode(body) {
|
|
1768
|
-
return api.post(
|
|
1776
|
+
return api.post(IDP_URL + "/api/Auth/send-code-email", body);
|
|
1769
1777
|
};
|
|
1770
1778
|
var apiCheckEmailCode = function apiCheckEmailCode(params) {
|
|
1771
|
-
return api.get(
|
|
1779
|
+
return api.get(IDP_URL + "/api/Auth/check-code-email", {
|
|
1772
1780
|
params: params
|
|
1773
1781
|
});
|
|
1774
1782
|
};
|
|
@@ -1865,6 +1873,8 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
1865
1873
|
var _useState5 = useState(0),
|
|
1866
1874
|
currentImageIndex = _useState5[0],
|
|
1867
1875
|
setCurrentImageIndex = _useState5[1];
|
|
1876
|
+
var search = new URLSearchParams(window.location.search);
|
|
1877
|
+
var returnUrl = search.get("returnUrl") || "";
|
|
1868
1878
|
var handleGetImage = function handleGetImage() {
|
|
1869
1879
|
try {
|
|
1870
1880
|
var _temp = _catch(function () {
|
|
@@ -1955,7 +1965,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
1955
1965
|
dispatch(setLoading(false));
|
|
1956
1966
|
}
|
|
1957
1967
|
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
1958
|
-
onNavigate("/dashboard");
|
|
1968
|
+
onNavigate(returnUrl || "/dashboard");
|
|
1959
1969
|
dispatch(setLoading(false));
|
|
1960
1970
|
});
|
|
1961
1971
|
}
|
|
@@ -2038,11 +2048,11 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2038
2048
|
}
|
|
2039
2049
|
};
|
|
2040
2050
|
var redirectUrl = getRedirectUrl(authResult.data.role);
|
|
2041
|
-
window.location.href = redirectUrl + "/dashboard";
|
|
2051
|
+
window.location.href = redirectUrl + " " + (returnUrl || "/dashboard");
|
|
2042
2052
|
dispatch(setLoading(false));
|
|
2043
2053
|
}
|
|
2044
2054
|
localStorage.setItem(ACCESS_TOKEN, tokenJWT);
|
|
2045
|
-
onNavigate("/dashboard");
|
|
2055
|
+
onNavigate(returnUrl || "/dashboard");
|
|
2046
2056
|
dispatch(setLoading(false));
|
|
2047
2057
|
});
|
|
2048
2058
|
}
|
|
@@ -2135,7 +2145,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2135
2145
|
to: "/",
|
|
2136
2146
|
className: "d-flex"
|
|
2137
2147
|
}, React.createElement("img", {
|
|
2138
|
-
src: "/images/Logo.png",
|
|
2148
|
+
src: PUBLIC_URL + "/images/Logo.png",
|
|
2139
2149
|
alt: "",
|
|
2140
2150
|
height: 37,
|
|
2141
2151
|
width: 155,
|
|
@@ -2162,7 +2172,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2162
2172
|
width: 24,
|
|
2163
2173
|
height: 24,
|
|
2164
2174
|
alt: "Google sign-in",
|
|
2165
|
-
src: "/images/icons/Google__G__logo.png"
|
|
2175
|
+
src: PUBLIC_URL + "/images/icons/Google__G__logo.png"
|
|
2166
2176
|
}), "Sign in with Google")), MICROSOFT_SSO_ENABLED === "true" && React.createElement("div", {
|
|
2167
2177
|
className: "" + styleGlobal["microsoft_button"]
|
|
2168
2178
|
}, React.createElement("button", {
|
|
@@ -2173,7 +2183,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2173
2183
|
width: 24,
|
|
2174
2184
|
height: 24,
|
|
2175
2185
|
alt: "Google sign-in",
|
|
2176
|
-
src: "/images/Single-Sign-On-logo.png"
|
|
2186
|
+
src: PUBLIC_URL + "/images/Single-Sign-On-logo.png"
|
|
2177
2187
|
}), "Sign in with Microsoft")), React.createElement("span", {
|
|
2178
2188
|
className: "" + styleGlobal["box-field"]
|
|
2179
2189
|
}, "OR"), React.createElement("div", {
|
|
@@ -2193,7 +2203,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2193
2203
|
width: 20,
|
|
2194
2204
|
height: 20,
|
|
2195
2205
|
alt: "Email sign-in",
|
|
2196
|
-
src: "/images/icons/Login_icon.png"
|
|
2206
|
+
src: PUBLIC_URL + "/images/icons/Login_icon.png"
|
|
2197
2207
|
}), "Sign in with Email")), React.createElement("div", {
|
|
2198
2208
|
className: styleGlobal["box-signin-text"] + " "
|
|
2199
2209
|
}, React.createElement("span", {
|
|
@@ -2227,7 +2237,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2227
2237
|
}))) : React.createElement("div", {
|
|
2228
2238
|
className: "" + styleGlobal["box-right"],
|
|
2229
2239
|
style: {
|
|
2230
|
-
backgroundImage: "url('/images/bg_login.png')"
|
|
2240
|
+
backgroundImage: "url('" + PUBLIC_URL + "/images/bg_login.png')"
|
|
2231
2241
|
}
|
|
2232
2242
|
}, React.createElement("div", {
|
|
2233
2243
|
className: "" + styleGlobal["box-right-body"]
|
|
@@ -2256,7 +2266,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2256
2266
|
}, React.createElement("img", {
|
|
2257
2267
|
className: "img-fluid",
|
|
2258
2268
|
alt: "",
|
|
2259
|
-
src: "/images/image_login.png",
|
|
2269
|
+
src: PUBLIC_URL + "/images/image_login.png",
|
|
2260
2270
|
style: {
|
|
2261
2271
|
width: "15vw"
|
|
2262
2272
|
}
|
|
@@ -2267,7 +2277,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2267
2277
|
marginTop: "-15px"
|
|
2268
2278
|
},
|
|
2269
2279
|
alt: "",
|
|
2270
|
-
src: "/images/icons/Vector 22.png"
|
|
2280
|
+
src: PUBLIC_URL + "/images/icons/Vector 22.png"
|
|
2271
2281
|
}))))))), role === "LandingPage" && React.createElement(Col, {
|
|
2272
2282
|
sm: 12,
|
|
2273
2283
|
lg: 5,
|
|
@@ -2275,7 +2285,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2275
2285
|
}, React.createElement("div", {
|
|
2276
2286
|
className: "" + styleGlobal["box-right"],
|
|
2277
2287
|
style: {
|
|
2278
|
-
backgroundImage: "url('/images/bg_login.png')"
|
|
2288
|
+
backgroundImage: "url('" + PUBLIC_URL + "/images/bg_login.png')"
|
|
2279
2289
|
}
|
|
2280
2290
|
}, React.createElement("div", {
|
|
2281
2291
|
className: "" + styleGlobal["box-right-body"]
|
|
@@ -2304,7 +2314,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2304
2314
|
}, React.createElement("img", {
|
|
2305
2315
|
className: "img-fluid",
|
|
2306
2316
|
alt: "",
|
|
2307
|
-
src: "/images/image_login.png",
|
|
2317
|
+
src: PUBLIC_URL + "/images/image_login.png",
|
|
2308
2318
|
style: {
|
|
2309
2319
|
width: "15vw"
|
|
2310
2320
|
}
|
|
@@ -2315,7 +2325,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
2315
2325
|
marginTop: "-15px"
|
|
2316
2326
|
},
|
|
2317
2327
|
alt: "",
|
|
2318
|
-
src: "/images/icons/Vector 22.png"
|
|
2328
|
+
src: PUBLIC_URL + "/images/icons/Vector 22.png"
|
|
2319
2329
|
})))))))), React.createElement(Modal, {
|
|
2320
2330
|
isOpen: isScreenCode,
|
|
2321
2331
|
toggle: function toggle() {
|
|
@@ -2441,6 +2451,8 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2441
2451
|
var _useState6 = useState(minutes * 60),
|
|
2442
2452
|
timeLeft = _useState6[0],
|
|
2443
2453
|
setTimeLeft = _useState6[1];
|
|
2454
|
+
var search = new URLSearchParams(window.location.search);
|
|
2455
|
+
var returnUrl = search.get("returnUrl") || "/dashboard";
|
|
2444
2456
|
var loginWithEmail = function loginWithEmail(role) {
|
|
2445
2457
|
try {
|
|
2446
2458
|
var _temp2 = function _temp2() {
|
|
@@ -2507,9 +2519,9 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
|
|
|
2507
2519
|
if ((_data$data$roles = data.data.roles) !== null && _data$data$roles !== void 0 && _data$data$roles.includes("Admin")) {
|
|
2508
2520
|
domain = ADMIN_ORIGIN;
|
|
2509
2521
|
}
|
|
2510
|
-
window.location.href = domain + "/dashboard";
|
|
2522
|
+
window.location.href = "" + domain + (returnUrl || "/dashboard");
|
|
2511
2523
|
} else {
|
|
2512
|
-
onNavigate("/dashboard");
|
|
2524
|
+
onNavigate(returnUrl || "/dashboard");
|
|
2513
2525
|
}
|
|
2514
2526
|
} else {
|
|
2515
2527
|
toast.error("The code is not correct. Please check again.");
|