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