mario-core 2.9.209-release → 2.9.212-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.
@@ -22378,6 +22378,10 @@ var useLogin = function useLogin() {
22378
22378
  profileImageFileName: profileImageFileName
22379
22379
  }));
22380
22380
 
22381
+ if (!localStorage.getItem("ROLES") && roles.includes("Admin")) {
22382
+ localStorage.setItem("ROLES", "Admin");
22383
+ }
22384
+
22381
22385
  if (data !== null && data !== void 0 && data.email && !roles.includes("Admin")) {
22382
22386
  var _data$roles;
22383
22387
 
@@ -22807,6 +22811,12 @@ var BlockLogin = function BlockLogin(_ref) {
22807
22811
  name = _res$profileObj.name;
22808
22812
  var accessToken = res.accessToken;
22809
22813
  var googleId = res.googleId;
22814
+
22815
+ if (email.includes("@gmail")) {
22816
+ alert("Please login with your school email");
22817
+ return;
22818
+ }
22819
+
22810
22820
  var infoLogin = {
22811
22821
  firstName: givenName,
22812
22822
  lastName: familyName,
@@ -23785,6 +23795,7 @@ var TheSidebar = function TheSidebar(_ref) {
23785
23795
 
23786
23796
  var signOut = useCallback(function () {
23787
23797
  localStorage.removeItem(ACCESS_TOKEN);
23798
+ localStorage.removeItem("ROLES");
23788
23799
  dispatch(reset());
23789
23800
  history.push("/");
23790
23801
  }, []);
@@ -23977,6 +23988,7 @@ var TheHeaderDropdown = function TheHeaderDropdown(_ref) {
23977
23988
  var isTeacher = roles.includes(TEACHER_ROLE);
23978
23989
  var signOut = useCallback(function () {
23979
23990
  localStorage.removeItem(ACCESS_TOKEN);
23991
+ localStorage.removeItem("ROLES");
23980
23992
  dispatch(reset());
23981
23993
  history.push("/");
23982
23994
  }, []);
@@ -24288,11 +24300,7 @@ var ModelSelectRole = function ModelSelectRole(_ref) {
24288
24300
  var roles = user === null || user === void 0 ? void 0 : user.roles;
24289
24301
 
24290
24302
  var handleSelectUserRoles = function handleSelectUserRoles(roles) {
24291
- if (roles.includes("Admin")) {
24292
- dispatch(setLoading(true));
24293
- return history.push("/admin/dashboard");
24294
- }
24295
-
24303
+ dispatch(setLoading(true));
24296
24304
  var roleSelect = roles.includes("Teacher/Assistant") ? ["Teacher", "Assistant"] : roles;
24297
24305
  dispatch(setUser(_extends({}, user, {
24298
24306
  roles: roleSelect
@@ -24302,6 +24310,8 @@ var ModelSelectRole = function ModelSelectRole(_ref) {
24302
24310
 
24303
24311
  if (roles.includes("Parent")) {
24304
24312
  history.push("/parent");
24313
+ } else if (roles.includes("Admin")) {
24314
+ history.push("/admin/dashboard");
24305
24315
  } else {
24306
24316
  pathname !== "/home" ? history.push("/home") : window.location.reload();
24307
24317
  }