mario-core 1.1.78-es-sso → 1.1.78-es-layout
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/containers/Login/constant/types.d.ts +1 -4
- package/dist/containers/Login/hooks/useLogin.d.ts +2 -4
- package/dist/index.css +0 -33
- package/dist/index.js +33 -233
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +33 -233
- package/dist/index.modern.js.map +1 -1
- package/dist/redux/commons/action.d.ts +0 -1
- package/dist/services/accountService.d.ts +1 -1
- package/package.json +1 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare enum TypeLogin {
|
|
2
|
-
Google = 0
|
|
3
|
-
ClassLink = 1,
|
|
4
|
-
MicrosoftSSO = 2
|
|
2
|
+
Google = 0
|
|
5
3
|
}
|
|
6
4
|
export interface IInformationUser {
|
|
7
5
|
firstName: string;
|
|
@@ -20,5 +18,4 @@ export declare enum LoginType {
|
|
|
20
18
|
export interface ISchool {
|
|
21
19
|
schoolName: string;
|
|
22
20
|
schoolLogo: string;
|
|
23
|
-
schoolId: number;
|
|
24
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ISchool
|
|
2
|
+
import { ISchool } from "../constant/types";
|
|
3
3
|
declare type LoginInfo = {
|
|
4
4
|
email: string;
|
|
5
5
|
password: string;
|
|
@@ -14,7 +14,7 @@ declare const useLogin: () => {
|
|
|
14
14
|
toggle: () => void;
|
|
15
15
|
isShowPassword: boolean;
|
|
16
16
|
setIsShowPassword: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
-
fnIsCheckLogin: (
|
|
17
|
+
fnIsCheckLogin: (data: any, token: string, clickHandler: any) => Promise<void>;
|
|
18
18
|
isLoginGoogle: boolean;
|
|
19
19
|
infoUser: any;
|
|
20
20
|
setInfoUser: import("react").Dispatch<any>;
|
|
@@ -23,7 +23,5 @@ declare const useLogin: () => {
|
|
|
23
23
|
googleClientId: string;
|
|
24
24
|
googleRecaptchaId: string;
|
|
25
25
|
school: ISchool;
|
|
26
|
-
fnLoginSSO: (clickHandler?: any) => Promise<void>;
|
|
27
|
-
handleLoginWidthClever: () => void;
|
|
28
26
|
};
|
|
29
27
|
export default useLogin;
|
package/dist/index.css
CHANGED
|
@@ -8,39 +8,6 @@
|
|
|
8
8
|
--core-blue-btn: #1b8eb7;
|
|
9
9
|
--core-blue-border: #1985ac; }
|
|
10
10
|
|
|
11
|
-
._DrSlA {
|
|
12
|
-
background: #EFF3FC;
|
|
13
|
-
font-size: 15px;
|
|
14
|
-
color: #ad9292;
|
|
15
|
-
border-radius: 50px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
display: flex;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
padding: 10px 0; }
|
|
21
|
-
._DrSlA img {
|
|
22
|
-
height: 26px;
|
|
23
|
-
margin-right: 10px; }
|
|
24
|
-
._DrSlA p {
|
|
25
|
-
margin-bottom: 0;
|
|
26
|
-
font-size: 18px;
|
|
27
|
-
font-weight: 700;
|
|
28
|
-
line-height: 27px;
|
|
29
|
-
text-align: left;
|
|
30
|
-
color: #316CD9;
|
|
31
|
-
font-family: "Poppins-Regular" !important; }
|
|
32
|
-
@media (max-width: 768px) {
|
|
33
|
-
._DrSlA p {
|
|
34
|
-
font-size: 14px;
|
|
35
|
-
line-height: 21px; } }
|
|
36
|
-
|
|
37
|
-
._DrSlA:hover {
|
|
38
|
-
background: #316CD9; }
|
|
39
|
-
._DrSlA:hover p {
|
|
40
|
-
color: #ffffff; }
|
|
41
|
-
._DrSlA:hover ._20YJX {
|
|
42
|
-
width: 32px !important; }
|
|
43
|
-
|
|
44
11
|
._2HqmH {
|
|
45
12
|
width: 100%;
|
|
46
13
|
justify-content: center;
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ var yup = require('yup');
|
|
|
12
12
|
var reactRedux = require('react-redux');
|
|
13
13
|
var toolkit = require('@reduxjs/toolkit');
|
|
14
14
|
var axios = _interopDefault(require('axios'));
|
|
15
|
-
var msalBrowser = require('@azure/msal-browser');
|
|
16
15
|
var reactGoogleRecaptchaV3 = require('react-google-recaptcha-v3');
|
|
17
16
|
var GoogleLogin = _interopDefault(require('react-google-login'));
|
|
18
17
|
var Select = _interopDefault(require('react-select'));
|
|
@@ -2113,6 +2112,7 @@ var prev = "Prev";
|
|
|
2113
2112
|
var select_the_grade = "Select the grade";
|
|
2114
2113
|
var class_qr_codes = "Class QR codes";
|
|
2115
2114
|
var title_is_required = "Title is required";
|
|
2115
|
+
var the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in = "The data presented in this chart reflects the student's <b>most recent check-in</b>.";
|
|
2116
2116
|
var lang_us = {
|
|
2117
2117
|
dashboard: dashboard,
|
|
2118
2118
|
user: user,
|
|
@@ -4228,7 +4228,8 @@ var lang_us = {
|
|
|
4228
4228
|
prev: prev,
|
|
4229
4229
|
select_the_grade: select_the_grade,
|
|
4230
4230
|
class_qr_codes: class_qr_codes,
|
|
4231
|
-
title_is_required: title_is_required
|
|
4231
|
+
title_is_required: title_is_required,
|
|
4232
|
+
the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in: the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in
|
|
4232
4233
|
};
|
|
4233
4234
|
|
|
4234
4235
|
var dashboard$1 = "Dashboard";
|
|
@@ -6307,6 +6308,7 @@ var prev$1 = "Prev";
|
|
|
6307
6308
|
var select_the_grade$1 = "Select the grade";
|
|
6308
6309
|
var class_qr_codes$1 = "Class QR codes";
|
|
6309
6310
|
var title_is_required$1 = "Title is required";
|
|
6311
|
+
var the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in$1 = "The data presented in this chart reflects the student's <b>most recent check-in</b>.";
|
|
6310
6312
|
var lang_uk = {
|
|
6311
6313
|
dashboard: dashboard$1,
|
|
6312
6314
|
user: user$1,
|
|
@@ -8422,7 +8424,8 @@ var lang_uk = {
|
|
|
8422
8424
|
prev: prev$1,
|
|
8423
8425
|
select_the_grade: select_the_grade$1,
|
|
8424
8426
|
class_qr_codes: class_qr_codes$1,
|
|
8425
|
-
title_is_required: title_is_required$1
|
|
8427
|
+
title_is_required: title_is_required$1,
|
|
8428
|
+
the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in: the_data_presented_in_this_chart_reflects_the_student_s_most_recent_check_in$1
|
|
8426
8429
|
};
|
|
8427
8430
|
|
|
8428
8431
|
var dashboard$2 = "لوحة المعلومات";
|
|
@@ -21418,7 +21421,7 @@ function _catch(body, recover) {
|
|
|
21418
21421
|
return result;
|
|
21419
21422
|
}
|
|
21420
21423
|
|
|
21421
|
-
var styles = {"btn-login-
|
|
21424
|
+
var styles = {"btn-login-google":"_2HqmH","notification-count":"_2sew7","text-introduction":"_3OgWF","btn-trans-border":"_r9cAh","contact":"_NszFe","learn-more":"_MDjzH","title-quote":"_1Swkw","descriptions-quote":"_gi8vj","box-login":"_38Lo1","block-verification":"_1OzGy","block-login":"_wWIyO","title-login":"_3nuns","title-forgot-password":"_21qb6","btn-close":"_NhW9l","btn-login":"_3IL10","school-icon":"_2OUwW","school-name":"_2Owso","login-description":"_fx-kA","return-to-login":"_Ce3Kg","recover-account":"_2t6d9","link-to-login":"_3bDsd","privacy-policy":"_I4SVu","remember":"_11FZt","term-and-conditions":"_3LXoI","descriptions-forgot-pass":"_PMcjT","content-icon":"_2rZY6","descriptions-icon":"_3SOdX","title-icon":"_y9lM2","digital-privacy-icon":"_141p1","nav-home":"_1TT1q","box-introduction":"_32V6L","icon":"_20YJX","checkbox-keep-login":"_1AiX0","label-keep-login":"_2uNvW","option-text":"_pqn4y","form-user-name":"_39BJD","input":"_ozRAq","checkbox-remember":"_2K9b2","btn-rounder":"_2VvIr","btn-active":"_2A0HF","block-reset-password":"_23Sua","block-forgot-pass":"_3CWP6","page-not-login":"_3Wmco","content-quote":"_13Rk0","home-page":"_o6HKW","red-background":"_jOY7o","login":"_F-hjL","login-content":"_149oA","logo-home":"_24U3W","img-box":"_2v-L_","img-login":"_3ncTL","img-login-rectangle":"_2kOvJ","c-main":"_39l0X","container-fluid":"_1BMwK","input-file-label":"_1XNpH","delete-avatar-button":"_1z5h9","header-logo":"_Gewcf","box-sidebar":"_2vcmv","sidebar-logo":"_1hXpy","sidebar-nav-links":"_3vb3s","c-active":"_36jSM","sidebar-nav-links-hover":"_DNrus","box-sidebar-header":"_3NEZj","box-logout":"_1wUDG","sidebar-btn-minimized":"_1S7Px","sidebar-logout":"_2P85D","nav-mobile":"_1qjbW","filter-media-file":"_1I62C","div":"_3cLcM","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","logout":"_1_9tV","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","hide-in-mobile":"_1INnO","popover__sort__item":"_1ocBa","popover__sort__item--active":"_18NhM","popover__search__icon":"_2bquW","popover__search__input":"_3A4G4","popover__options":"_1MsEW","item-select-role":"_1KcY7","item-role-active":"_dOVso","model-switch-roles":"_3ZqxI","title":"_g-p72","bg-animate":"_30npl","active":"_3oAH-","show":"_16rY4","fade-in":"_26nbh","behind":"_3A7Vv","hamburger-menu":"_2yRc8","box-content-home-page":"_ABUIP","collapse-box":"_WX97m","hide-in-desktop":"_2LIqK","control-input":"_2Zz97","custom-control":"_3-yp5","font-large":"_3Sup6","custom-title-font-size":"_2aaqy","modal-title":"_13Gcm","custom-font-size":"_VzIb0","font-small":"_2JnMg"};
|
|
21422
21425
|
|
|
21423
21426
|
var style = {
|
|
21424
21427
|
fontSize: "0.85rem"
|
|
@@ -21566,7 +21569,6 @@ var getAccessToken = (function () {
|
|
|
21566
21569
|
var setLoading = toolkit.createAction("common/setLoading");
|
|
21567
21570
|
var setModal = toolkit.createAction("common/setModal");
|
|
21568
21571
|
var setUser = toolkit.createAction("common/setUser");
|
|
21569
|
-
var setInforUserGoogle = toolkit.createAction("common/setInforUserGoogle");
|
|
21570
21572
|
var setSidebar = toolkit.createAction("common/setSidebar");
|
|
21571
21573
|
var setAlert = toolkit.createAction("common/setAlert");
|
|
21572
21574
|
var reset = toolkit.createAction("common/reset");
|
|
@@ -21677,12 +21679,8 @@ var checkResetToken = function checkResetToken(token) {
|
|
|
21677
21679
|
var resetPassword = function resetPassword(data) {
|
|
21678
21680
|
return api.post(ACCOUNT_URL + "/resetpassword", data);
|
|
21679
21681
|
};
|
|
21680
|
-
var checkUserGoogle = function checkUserGoogle(
|
|
21681
|
-
return api.post(USER_URL + "/check-user", body
|
|
21682
|
-
params: {
|
|
21683
|
-
type: type
|
|
21684
|
-
}
|
|
21685
|
-
});
|
|
21682
|
+
var checkUserGoogle = function checkUserGoogle(body) {
|
|
21683
|
+
return api.post(USER_URL + "/check-user", body);
|
|
21686
21684
|
};
|
|
21687
21685
|
var getAllLoginTeacher = function getAllLoginTeacher(param) {
|
|
21688
21686
|
return api.get(TEACHER_URL + "/get-teacher-login", {
|
|
@@ -21696,75 +21694,11 @@ var registerUserStudent = function registerUserStudent(body) {
|
|
|
21696
21694
|
return api.post(BASE_URL + "/api/User/register-user", body);
|
|
21697
21695
|
};
|
|
21698
21696
|
|
|
21699
|
-
var TypeLogin;
|
|
21700
|
-
|
|
21701
|
-
(function (TypeLogin) {
|
|
21702
|
-
TypeLogin[TypeLogin["Google"] = 0] = "Google";
|
|
21703
|
-
TypeLogin[TypeLogin["ClassLink"] = 1] = "ClassLink";
|
|
21704
|
-
TypeLogin[TypeLogin["MicrosoftSSO"] = 2] = "MicrosoftSSO";
|
|
21705
|
-
})(TypeLogin || (TypeLogin = {}));
|
|
21706
|
-
|
|
21707
|
-
var LoginType;
|
|
21708
|
-
|
|
21709
|
-
(function (LoginType) {
|
|
21710
|
-
LoginType[LoginType["Default"] = 0] = "Default";
|
|
21711
|
-
LoginType[LoginType["Google"] = 1] = "Google";
|
|
21712
|
-
LoginType[LoginType["Impersonate"] = 2] = "Impersonate";
|
|
21713
|
-
})(LoginType || (LoginType = {}));
|
|
21714
|
-
|
|
21715
21697
|
var SCHOOL_URL = BASE_URL + "/api/school";
|
|
21716
21698
|
var getSchoolSettings = function getSchoolSettings() {
|
|
21717
21699
|
return api.get(SCHOOL_URL + "/settings");
|
|
21718
21700
|
};
|
|
21719
21701
|
|
|
21720
|
-
var msalConfig = {
|
|
21721
|
-
auth: {
|
|
21722
|
-
clientId: isLocalhost ? "a27f8ac9-e039-4bbd-a9e1-3096e52a77bb" : "3845e9f8-aead-4535-b4bb-d363a1d262bd",
|
|
21723
|
-
authority: "https://login.microsoftonline.com/common",
|
|
21724
|
-
redirectUri: "https://es-sso.marioforme.com/microsoft-login.html"
|
|
21725
|
-
},
|
|
21726
|
-
cache: {
|
|
21727
|
-
cacheLocation: "sessionStorage",
|
|
21728
|
-
storeAuthStateInCookie: false
|
|
21729
|
-
},
|
|
21730
|
-
system: {
|
|
21731
|
-
loggerOptions: {
|
|
21732
|
-
loggerCallback: function loggerCallback(level, message, containsPii) {
|
|
21733
|
-
if (containsPii) {
|
|
21734
|
-
return;
|
|
21735
|
-
}
|
|
21736
|
-
|
|
21737
|
-
switch (level) {
|
|
21738
|
-
case msalBrowser.LogLevel.Error:
|
|
21739
|
-
console.error(message);
|
|
21740
|
-
return;
|
|
21741
|
-
|
|
21742
|
-
case msalBrowser.LogLevel.Info:
|
|
21743
|
-
console.info(message);
|
|
21744
|
-
return;
|
|
21745
|
-
|
|
21746
|
-
case msalBrowser.LogLevel.Verbose:
|
|
21747
|
-
console.debug(message);
|
|
21748
|
-
return;
|
|
21749
|
-
|
|
21750
|
-
case msalBrowser.LogLevel.Warning:
|
|
21751
|
-
console.warn(message);
|
|
21752
|
-
return;
|
|
21753
|
-
|
|
21754
|
-
default:
|
|
21755
|
-
return;
|
|
21756
|
-
}
|
|
21757
|
-
}
|
|
21758
|
-
}
|
|
21759
|
-
}
|
|
21760
|
-
};
|
|
21761
|
-
|
|
21762
|
-
var getCookieValue = function getCookieValue(name) {
|
|
21763
|
-
var _document$cookie$matc;
|
|
21764
|
-
|
|
21765
|
-
return ((_document$cookie$matc = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')) === null || _document$cookie$matc === void 0 ? void 0 : _document$cookie$matc.pop()) || '';
|
|
21766
|
-
};
|
|
21767
|
-
|
|
21768
21702
|
var _sessionStorage$getIt;
|
|
21769
21703
|
var defaultInfo = {
|
|
21770
21704
|
email: "",
|
|
@@ -21807,34 +21741,21 @@ var useLogin = function useLogin() {
|
|
|
21807
21741
|
|
|
21808
21742
|
var _useState6 = React.useState({
|
|
21809
21743
|
schoolName: "",
|
|
21810
|
-
schoolLogo: ""
|
|
21811
|
-
schoolId: 0
|
|
21744
|
+
schoolLogo: ""
|
|
21812
21745
|
}),
|
|
21813
21746
|
school = _useState6[0],
|
|
21814
21747
|
setSchool = _useState6[1];
|
|
21815
21748
|
|
|
21816
|
-
var _useState7 = React.useState(),
|
|
21817
|
-
msalInstance = _useState7[0],
|
|
21818
|
-
setMsalInstance = _useState7[1];
|
|
21819
|
-
|
|
21820
21749
|
var toggle = React.useCallback(function () {
|
|
21821
21750
|
setOpenLogin(!openLogin);
|
|
21822
21751
|
}, [openLogin]);
|
|
21823
21752
|
|
|
21824
|
-
var
|
|
21825
|
-
isShowPassword =
|
|
21826
|
-
setIsShowPassword =
|
|
21753
|
+
var _useState7 = React.useState(false),
|
|
21754
|
+
isShowPassword = _useState7[0],
|
|
21755
|
+
setIsShowPassword = _useState7[1];
|
|
21827
21756
|
|
|
21828
21757
|
React.useEffect(function () {
|
|
21829
21758
|
document.title = TITLE;
|
|
21830
|
-
var authToken = getCookieValue("auth-token");
|
|
21831
|
-
|
|
21832
|
-
if (authToken) {
|
|
21833
|
-
localStorage.setItem(ACCESS_TOKEN, authToken);
|
|
21834
|
-
document.cookie = "auth-token" + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
|
21835
|
-
document.cookie = "redirect-uri" + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
|
21836
|
-
}
|
|
21837
|
-
|
|
21838
21759
|
var token = getAccessToken();
|
|
21839
21760
|
if (!!token) history.push("/");
|
|
21840
21761
|
getInfoGoogle();
|
|
@@ -21941,7 +21862,7 @@ var useLogin = function useLogin() {
|
|
|
21941
21862
|
}
|
|
21942
21863
|
};
|
|
21943
21864
|
|
|
21944
|
-
var fnIsCheckLogin = React.useCallback(function (
|
|
21865
|
+
var fnIsCheckLogin = React.useCallback(function (data, token, clickHandler) {
|
|
21945
21866
|
try {
|
|
21946
21867
|
var _temp10 = function _temp10() {
|
|
21947
21868
|
dispatch(setLoading(false));
|
|
@@ -21950,7 +21871,7 @@ var useLogin = function useLogin() {
|
|
|
21950
21871
|
dispatch(setLoading(true));
|
|
21951
21872
|
|
|
21952
21873
|
var _temp11 = _catch(function () {
|
|
21953
|
-
return Promise.resolve(checkUserGoogle(
|
|
21874
|
+
return Promise.resolve(checkUserGoogle(data)).then(function (res) {
|
|
21954
21875
|
var checkUser = res.data;
|
|
21955
21876
|
|
|
21956
21877
|
var _temp7 = function () {
|
|
@@ -22046,66 +21967,9 @@ var useLogin = function useLogin() {
|
|
|
22046
21967
|
}
|
|
22047
21968
|
};
|
|
22048
21969
|
|
|
22049
|
-
var fnLoginSSO = function fnLoginSSO(clickHandler) {
|
|
22050
|
-
try {
|
|
22051
|
-
msalInstance.handleRedirectPromise().then(function (tokenResponse) {
|
|
22052
|
-
try {
|
|
22053
|
-
var _temp19 = function () {
|
|
22054
|
-
if (!tokenResponse) {
|
|
22055
|
-
var accounts = msalInstance.getAllAccounts();
|
|
22056
|
-
|
|
22057
|
-
var _temp20 = function () {
|
|
22058
|
-
if (accounts.length === 0) {
|
|
22059
|
-
var domainRedirect = isLocalhost ? "https://brightsoft.marioforme.com" : "https://es-sso.marioforme.com";
|
|
22060
|
-
window.location.href = (window.location.hostname === "localhost" ? "https://localhost:5001" : domainRedirect) + ("/microsoft-login.html?redirect-uri=" + window.location.href + "&schoolId=" + school.schoolId);
|
|
22061
|
-
} else {
|
|
22062
|
-
var currentAccount = accounts[0];
|
|
22063
|
-
return Promise.resolve(getCurrentAccount(currentAccount, clickHandler)).then(function () {});
|
|
22064
|
-
}
|
|
22065
|
-
}();
|
|
22066
|
-
|
|
22067
|
-
if (_temp20 && _temp20.then) return _temp20.then(function () {});
|
|
22068
|
-
} else {
|
|
22069
|
-
var currentAccount = tokenResponse.account;
|
|
22070
|
-
return Promise.resolve(getCurrentAccount(currentAccount, clickHandler)).then(function () {});
|
|
22071
|
-
}
|
|
22072
|
-
}();
|
|
22073
|
-
|
|
22074
|
-
return Promise.resolve(_temp19 && _temp19.then ? _temp19.then(function () {}) : void 0);
|
|
22075
|
-
} catch (e) {
|
|
22076
|
-
return Promise.reject(e);
|
|
22077
|
-
}
|
|
22078
|
-
})["catch"](function (err) {
|
|
22079
|
-
console.error(err);
|
|
22080
|
-
});
|
|
22081
|
-
return Promise.resolve();
|
|
22082
|
-
} catch (e) {
|
|
22083
|
-
return Promise.reject(e);
|
|
22084
|
-
}
|
|
22085
|
-
};
|
|
22086
|
-
|
|
22087
|
-
var getCurrentAccount = function getCurrentAccount(account, clickHandler) {
|
|
22088
|
-
try {
|
|
22089
|
-
var fullName = account.name;
|
|
22090
|
-
var infoLogin = {
|
|
22091
|
-
firstName: fullName.split(' ').slice(0, -1).join(' '),
|
|
22092
|
-
lastName: fullName.split(' ').slice(-1).join(' '),
|
|
22093
|
-
fullName: fullName,
|
|
22094
|
-
imageUrl: "",
|
|
22095
|
-
email: account.username,
|
|
22096
|
-
accessToken: account.idTokenClaims.aio,
|
|
22097
|
-
googleId: account.tenantId
|
|
22098
|
-
};
|
|
22099
|
-
dispatch(setInforUserGoogle(infoLogin));
|
|
22100
|
-
return Promise.resolve(fnIsCheckLogin(TypeLogin.MicrosoftSSO, infoLogin, account.idTokenClaims.aio, clickHandler)).then(function () {});
|
|
22101
|
-
} catch (e) {
|
|
22102
|
-
return Promise.reject(e);
|
|
22103
|
-
}
|
|
22104
|
-
};
|
|
22105
|
-
|
|
22106
21970
|
var getInformationSetting = function getInformationSetting() {
|
|
22107
21971
|
try {
|
|
22108
|
-
var
|
|
21972
|
+
var _temp18 = _catch(function () {
|
|
22109
21973
|
return Promise.resolve(getSchoolSettings()).then(function (res) {
|
|
22110
21974
|
setSchool(res.data);
|
|
22111
21975
|
});
|
|
@@ -22113,44 +21977,12 @@ var useLogin = function useLogin() {
|
|
|
22113
21977
|
console.error(err);
|
|
22114
21978
|
});
|
|
22115
21979
|
|
|
22116
|
-
return Promise.resolve(
|
|
21980
|
+
return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(function () {}) : void 0);
|
|
22117
21981
|
} catch (e) {
|
|
22118
21982
|
return Promise.reject(e);
|
|
22119
21983
|
}
|
|
22120
21984
|
};
|
|
22121
21985
|
|
|
22122
|
-
var handleLoginWidthClever = function handleLoginWidthClever() {
|
|
22123
|
-
if (!isLocalhost) {
|
|
22124
|
-
var cleverSSOUrl = "https://clever.com/oauth/authorize?response_type=code&redirect_uri=" + encodeURIComponent("https://classlink.marioforme.com/api/clever/clever-login") + "&client_id=" + "c3da6c669d239c70d48e";
|
|
22125
|
-
window.location.href = cleverSSOUrl;
|
|
22126
|
-
} else {
|
|
22127
|
-
var _cleverSSOUrl = "https://clever.com/oauth/instant-login?client_id=44f4bbf55cd873d3f7e5&district_id=6620cba31f1ddde7bd689dc5";
|
|
22128
|
-
window.location.href = _cleverSSOUrl;
|
|
22129
|
-
}
|
|
22130
|
-
};
|
|
22131
|
-
|
|
22132
|
-
var initInformationSSO = function initInformationSSO() {
|
|
22133
|
-
try {
|
|
22134
|
-
var _msalInstance = new msalBrowser.PublicClientApplication(msalConfig);
|
|
22135
|
-
|
|
22136
|
-
setMsalInstance(_msalInstance);
|
|
22137
|
-
return Promise.resolve();
|
|
22138
|
-
} catch (e) {
|
|
22139
|
-
return Promise.reject(e);
|
|
22140
|
-
}
|
|
22141
|
-
};
|
|
22142
|
-
|
|
22143
|
-
React.useEffect(function () {
|
|
22144
|
-
var redirectUrl = window.location.href;
|
|
22145
|
-
|
|
22146
|
-
if (!!msalInstance && redirectUrl.includes("code") && redirectUrl.includes("client_info")) {
|
|
22147
|
-
fnLoginSSO();
|
|
22148
|
-
}
|
|
22149
|
-
}, [JSON.stringify(msalInstance)]);
|
|
22150
|
-
React.useEffect(function () {
|
|
22151
|
-
getInformationSetting();
|
|
22152
|
-
initInformationSSO();
|
|
22153
|
-
}, []);
|
|
22154
21986
|
return {
|
|
22155
21987
|
defaultInfo: defaultInfo,
|
|
22156
21988
|
userLogin: userLogin,
|
|
@@ -22166,9 +21998,7 @@ var useLogin = function useLogin() {
|
|
|
22166
21998
|
setIsLoginGoogle: setIsLoginGoogle,
|
|
22167
21999
|
googleClientId: googleClientId,
|
|
22168
22000
|
googleRecaptchaId: googleRecaptchaId,
|
|
22169
|
-
school: school
|
|
22170
|
-
fnLoginSSO: fnLoginSSO,
|
|
22171
|
-
handleLoginWidthClever: handleLoginWidthClever
|
|
22001
|
+
school: school
|
|
22172
22002
|
};
|
|
22173
22003
|
};
|
|
22174
22004
|
|
|
@@ -22351,9 +22181,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
22351
22181
|
submitLogin = _useLogin.submitLogin,
|
|
22352
22182
|
infoUser = _useLogin.infoUser,
|
|
22353
22183
|
setIsLoginGoogle = _useLogin.setIsLoginGoogle,
|
|
22354
|
-
googleClientId = _useLogin.googleClientId
|
|
22355
|
-
fnLoginSSO = _useLogin.fnLoginSSO,
|
|
22356
|
-
handleLoginWidthClever = _useLogin.handleLoginWidthClever;
|
|
22184
|
+
googleClientId = _useLogin.googleClientId;
|
|
22357
22185
|
|
|
22358
22186
|
var togglePasswordVisible = function togglePasswordVisible() {
|
|
22359
22187
|
return setIsShowPassword(!isShowPassword);
|
|
@@ -22399,7 +22227,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
22399
22227
|
googleId: googleId
|
|
22400
22228
|
};
|
|
22401
22229
|
setInfoUser(infoLogin);
|
|
22402
|
-
fnIsCheckLogin(
|
|
22230
|
+
fnIsCheckLogin(infoLogin, accessToken, clickHandler);
|
|
22403
22231
|
}
|
|
22404
22232
|
};
|
|
22405
22233
|
|
|
@@ -22493,13 +22321,13 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
22493
22321
|
}, "Forgot password?")), React__default.createElement("button", {
|
|
22494
22322
|
className: styles["btn-login"] + " mt-5",
|
|
22495
22323
|
type: "submit"
|
|
22496
|
-
}, "LOG IN"), React__default.createElement("p", {
|
|
22324
|
+
}, "LOG IN"), googleClientId && React__default.createElement("p", {
|
|
22497
22325
|
className: styles["option-text"] + " my-3 text-center"
|
|
22498
22326
|
}, "OR"), React__default.createElement(reactstrap.Row, {
|
|
22499
22327
|
className: "mb-4"
|
|
22500
22328
|
}, React__default.createElement(reactstrap.Col, {
|
|
22501
|
-
lg:
|
|
22502
|
-
md:
|
|
22329
|
+
lg: 12,
|
|
22330
|
+
md: 12,
|
|
22503
22331
|
xs: 12,
|
|
22504
22332
|
className: "pr-md-2"
|
|
22505
22333
|
}, !!googleClientId && React__default.createElement(GoogleLogin, {
|
|
@@ -22508,44 +22336,14 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
|
22508
22336
|
onSuccess: onSuccessGoogle,
|
|
22509
22337
|
cookiePolicy: "single_host_origin",
|
|
22510
22338
|
className: styles["btn-login-google"] + " p-0 mb-4 mb-md-0"
|
|
22511
|
-
}))
|
|
22512
|
-
lg: 6,
|
|
22513
|
-
md: 6,
|
|
22514
|
-
xs: 12,
|
|
22515
|
-
className: styles["btn-login-sso"] + " pl-md-2"
|
|
22516
|
-
}, React__default.createElement("div", {
|
|
22517
|
-
className: styles["btn-login-with-sso"],
|
|
22518
|
-
onClick: function onClick() {
|
|
22519
|
-
return fnLoginSSO(clickHandler);
|
|
22520
|
-
}
|
|
22521
|
-
}, React__default.createElement("img", {
|
|
22522
|
-
src: "images/microsoft-logo.png"
|
|
22523
|
-
}), React__default.createElement("p", null, "MICROSOFT")))), React__default.createElement("div", {
|
|
22524
|
-
className: "" + styles["btn-login-sso"]
|
|
22525
|
-
}, React__default.createElement("div", {
|
|
22526
|
-
className: styles["btn-login-with-sso"],
|
|
22527
|
-
onClick: function onClick() {
|
|
22528
|
-
return window.open("https://launchpad.classlink.com/login");
|
|
22529
|
-
}
|
|
22530
|
-
}, React__default.createElement("img", {
|
|
22531
|
-
src: "images/class-link-icon.png"
|
|
22532
|
-
}), React__default.createElement("p", null, "SIGN IN WITH CLASSLINK"))), React__default.createElement("div", {
|
|
22533
|
-
className: styles["btn-login-sso"] + " mt-4"
|
|
22534
|
-
}, React__default.createElement("div", {
|
|
22535
|
-
className: styles["btn-login-with-sso"],
|
|
22536
|
-
onClick: function onClick() {
|
|
22537
|
-
return handleLoginWidthClever();
|
|
22538
|
-
}
|
|
22539
|
-
}, React__default.createElement("img", {
|
|
22540
|
-
src: "images/clever-icon.png"
|
|
22541
|
-
}), React__default.createElement("p", null, "SIGN IN WITH CLEVER"))))));
|
|
22339
|
+
}))))));
|
|
22542
22340
|
}), isLoginGoogle && React__default.createElement(BlockSelectTeacher$1, {
|
|
22543
22341
|
onSubmit: function onSubmit(e) {
|
|
22544
22342
|
return submitLogin(e, clickHandler);
|
|
22545
22343
|
},
|
|
22546
22344
|
openModal: isLoginGoogle,
|
|
22547
|
-
token: infoUser
|
|
22548
|
-
email: infoUser
|
|
22345
|
+
token: infoUser.accessToken,
|
|
22346
|
+
email: infoUser.email,
|
|
22549
22347
|
setOpenModal: setIsLoginGoogle
|
|
22550
22348
|
}));
|
|
22551
22349
|
};
|
|
@@ -30391,9 +30189,7 @@ var initialState = {
|
|
|
30391
30189
|
isEnableSurvey: false,
|
|
30392
30190
|
isConversationOneToOne: false,
|
|
30393
30191
|
loadUnreadNotification: false,
|
|
30394
|
-
language: DEFAULT_LANGUAGE_CODE
|
|
30395
|
-
isLoginGoogle: false,
|
|
30396
|
-
inforUserGoogle: null
|
|
30192
|
+
language: DEFAULT_LANGUAGE_CODE
|
|
30397
30193
|
};
|
|
30398
30194
|
var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
30399
30195
|
builder.addCase(setLoading, function (state, action) {
|
|
@@ -30404,8 +30200,6 @@ var commonReducer = toolkit.createReducer(initialState, function (builder) {
|
|
|
30404
30200
|
state.user = action.payload;
|
|
30405
30201
|
}).addCase(setSidebar, function (state, action) {
|
|
30406
30202
|
state.sidebarShow = action.payload;
|
|
30407
|
-
}).addCase(setInforUserGoogle, function (state, action) {
|
|
30408
|
-
state.inforUserGoogle = action.payload;
|
|
30409
30203
|
}).addCase(setAlert, function (state, action) {
|
|
30410
30204
|
state.alert = action.payload;
|
|
30411
30205
|
}).addCase(reset, function (_state, _action) {
|
|
@@ -31375,6 +31169,12 @@ var generateRandomString = (function () {
|
|
|
31375
31169
|
return (Math.random() + 1).toString(36).substring(7);
|
|
31376
31170
|
});
|
|
31377
31171
|
|
|
31172
|
+
var getCookieValue = function getCookieValue(name) {
|
|
31173
|
+
var _document$cookie$matc;
|
|
31174
|
+
|
|
31175
|
+
return ((_document$cookie$matc = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')) === null || _document$cookie$matc === void 0 ? void 0 : _document$cookie$matc.pop()) || '';
|
|
31176
|
+
};
|
|
31177
|
+
|
|
31378
31178
|
var apiGetLanguage = function apiGetLanguage() {
|
|
31379
31179
|
return api.get(BASE_URL + "/api/language");
|
|
31380
31180
|
};
|