mario-core 2.9.312-release → 2.9.314-release
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 +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -38411,6 +38411,7 @@ var useLogin = function useLogin() {
|
|
|
38411
38411
|
var params = new URLSearchParams(location.search);
|
|
38412
38412
|
var loginClassLink = params.get("type") === "classlink";
|
|
38413
38413
|
var tokenClassLink = params.get("token");
|
|
38414
|
+
var isAdminUser = params.get("isAdminUser");
|
|
38414
38415
|
|
|
38415
38416
|
var _useState4 = useState(false),
|
|
38416
38417
|
openModelAssign = _useState4[0];
|
|
@@ -38440,15 +38441,20 @@ var useLogin = function useLogin() {
|
|
|
38440
38441
|
var authToken = getCookieValue("auth-token");
|
|
38441
38442
|
|
|
38442
38443
|
if (authToken) {
|
|
38444
|
+
var domain = window.location.hostname;
|
|
38443
38445
|
localStorage.setItem(ACCESS_TOKEN, authToken);
|
|
38444
|
-
document.cookie = "auth-token=;domain
|
|
38446
|
+
document.cookie = "auth-token=;domain=" + (domain.includes("localhost") ? domain : ".marioforme.com") + "; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
|
|
38445
38447
|
document.cookie = "redirect-uri=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
|
|
38448
|
+
|
|
38449
|
+
if (!!isAdminUser) {
|
|
38450
|
+
return history.push("/admin/home");
|
|
38451
|
+
}
|
|
38446
38452
|
}
|
|
38447
38453
|
|
|
38448
38454
|
var token = getAccessToken();
|
|
38449
38455
|
if (!!token) history.push("/");
|
|
38450
38456
|
getInfoGoogle();
|
|
38451
|
-
}, []);
|
|
38457
|
+
}, [isAdminUser]);
|
|
38452
38458
|
|
|
38453
38459
|
var handleCancelModelAssign = function handleCancelModelAssign() {
|
|
38454
38460
|
localStorage.removeItem(ACCESS_TOKEN);
|