acsi-core 1.2.18 → 1.2.21

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
@@ -2494,7 +2494,17 @@ var useLogin = function useLogin(onNavigate, trackEvent) {
2494
2494
  timestamp: new Date().toISOString()
2495
2495
  }
2496
2496
  });
2497
- onNavigate("/dashboard");
2497
+ var isRootDomain = window.location.hostname === REQUEST_ORIGIN || window.location.hostname === "www." + REQUEST_ORIGIN;
2498
+ if (isRootDomain) {
2499
+ var _data$data$roles;
2500
+ var domain = TEACHER_ORIGIN;
2501
+ if ((_data$data$roles = data.data.roles) !== null && _data$data$roles !== void 0 && _data$data$roles.includes("Admin")) {
2502
+ domain = ADMIN_ORIGIN;
2503
+ }
2504
+ window.location.href = domain + "/dashboard";
2505
+ } else {
2506
+ onNavigate("/dashboard");
2507
+ }
2498
2508
  } else {
2499
2509
  reactToastify.toast.error("The code is not correct. Please check again.");
2500
2510
  }