mario-core 2.9.226-sso → 2.9.227-sso

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.
@@ -27,4 +27,5 @@ export declare enum LoginType {
27
27
  export interface ISchool {
28
28
  schoolName: string;
29
29
  schoolLogo: string;
30
+ schoolId: number;
30
31
  }
package/dist/index.js CHANGED
@@ -3983,7 +3983,7 @@ var lang_us = {
3983
3983
  select_question_to_add: select_question_to_add,
3984
3984
  all_of_the_students_marked_as_feeling_safe: all_of_the_students_marked_as_feeling_safe,
3985
3985
  integrations: integrations,
3986
- "this_check_in_will_be_deleted_from_all_databases._are_you_sure_you_want_to_continue?": "This Check-in will be deleted from all databases. Are you sure you want to continue?"
3986
+ "this_check_in_will_be_deleted_from_all_databases._are_you_sure_you_want_to_continue?": "This check-in will be deleted from all databases. Are you sure you want to continue?"
3987
3987
  };
3988
3988
 
3989
3989
  var dashboard$1 = "Dashboard";
@@ -7929,7 +7929,7 @@ var lang_uk = {
7929
7929
  select_question_to_add: select_question_to_add$1,
7930
7930
  all_of_the_students_marked_as_feeling_safe: all_of_the_students_marked_as_feeling_safe$1,
7931
7931
  integrations: integrations$1,
7932
- "this_check_in_will_be_deleted_from_all_databases._are_you_sure_you_want_to_continue?": "This Check-in will be deleted from all databases. Are you sure you want to continue?"
7932
+ "this_check_in_will_be_deleted_from_all_databases._are_you_sure_you_want_to_continue?": "This check-in will be deleted from all databases. Are you sure you want to continue?"
7933
7933
  };
7934
7934
 
7935
7935
  var dashboard$2 = "لوحة المعلومات";
@@ -37538,6 +37538,8 @@ var BlockLogin = function BlockLogin(_ref) {
37538
37538
 
37539
37539
  var onSuccessGoogle = function onSuccessGoogle(res) {
37540
37540
  if (!!(res !== null && res !== void 0 && res.accessToken)) {
37541
+ var _hostName$split, _email$split;
37542
+
37541
37543
  var _res$profileObj = res.profileObj,
37542
37544
  email = _res$profileObj.email,
37543
37545
  familyName = _res$profileObj.familyName,
@@ -37546,8 +37548,11 @@ var BlockLogin = function BlockLogin(_ref) {
37546
37548
  name = _res$profileObj.name;
37547
37549
  var accessToken = res.accessToken;
37548
37550
  var googleId = res.googleId;
37551
+ var hostName = window.location.hostname;
37552
+ var subDomain = (_hostName$split = hostName.split(".marioforme.com")) === null || _hostName$split === void 0 ? void 0 : _hostName$split[0];
37553
+ var emailDomain = (_email$split = email.split("@")) === null || _email$split === void 0 ? void 0 : _email$split[1];
37549
37554
 
37550
- if (email.includes("@gmail")) {
37555
+ if (email.includes("@gmail") || !emailDomain.includes(subDomain)) {
37551
37556
  alert("The email address you used does not match the login information in the database. Please check that you are using your school assigned email address to log into MARIO for Me. If you have further trouble please notify your school site administrator");
37552
37557
  return;
37553
37558
  }
@@ -38420,7 +38425,8 @@ var useLogin = function useLogin() {
38420
38425
 
38421
38426
  var _useState5 = React.useState({
38422
38427
  schoolName: "",
38423
- schoolLogo: ""
38428
+ schoolLogo: "",
38429
+ schoolId: 0
38424
38430
  }),
38425
38431
  school = _useState5[0],
38426
38432
  setSchool = _useState5[1];
@@ -38526,7 +38532,8 @@ var useLogin = function useLogin() {
38526
38532
  if (!!res.data) {
38527
38533
  setSchool({
38528
38534
  schoolName: res.data.schoolName,
38529
- schoolLogo: !schoolLogo ? getStaticFileUrl("/images/logo_header_blue.png") : getFileUrl(schoolLogo)
38535
+ schoolLogo: !schoolLogo ? getStaticFileUrl("/images/logo_header_blue.png") : getFileUrl(schoolLogo),
38536
+ schoolId: res.data.schoolId
38530
38537
  });
38531
38538
  }
38532
38539
  });
@@ -38850,7 +38857,9 @@ var useLogin = function useLogin() {
38850
38857
 
38851
38858
  var _temp39 = function () {
38852
38859
  if (accounts.length === 0) {
38853
- window.location.href = window.location.origin + ("/microsoft-login.html?redirect-uri=" + window.location.href);
38860
+ console.log(school.schoolId);
38861
+ var domainRedirect = isLocalhost ? "https://brightsoft.marioforme.com" : "https://microsoft-login.marioforme.com";
38862
+ window.location.href = (window.location.hostname === "localhost" ? "https://localhost:5001" : domainRedirect) + ("/microsoft-login.html?redirect-uri=" + window.location.href + "&schoolId=" + school.schoolId);
38854
38863
  } else {
38855
38864
  var currentAccount = accounts[0];
38856
38865
  return Promise.resolve(getCurrentAccount(currentAccount, clickHandler)).then(function () {});