mario-core 2.9.101-beta → 2.9.102-beta

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.
@@ -19,5 +19,6 @@ declare const useLogin: () => {
19
19
  submitLogin: (teacherId: number, clickHandler: any) => Promise<void>;
20
20
  setIsLoginGoogle: import("react").Dispatch<import("react").SetStateAction<boolean>>;
21
21
  googleClientId: string;
22
+ googleRecaptchaId: string;
22
23
  };
23
24
  export default useLogin;
package/dist/index.js CHANGED
@@ -2771,17 +2771,21 @@ var useLogin = function useLogin() {
2771
2771
  googleClientId = _useState3[0],
2772
2772
  setGoogleClientId = _useState3[1];
2773
2773
 
2774
- var _useState4 = React.useState(),
2775
- infoUser = _useState4[0],
2776
- setInfoUser = _useState4[1];
2774
+ var _useState4 = React.useState(""),
2775
+ googleRecaptchaId = _useState4[0],
2776
+ setGoogleRecaptchaId = _useState4[1];
2777
+
2778
+ var _useState5 = React.useState(),
2779
+ infoUser = _useState5[0],
2780
+ setInfoUser = _useState5[1];
2777
2781
 
2778
2782
  var toggle = React.useCallback(function () {
2779
2783
  setOpenLogin(!openLogin);
2780
2784
  }, [openLogin]);
2781
2785
 
2782
- var _useState5 = React.useState(false),
2783
- isShowPassword = _useState5[0],
2784
- setIsShowPassword = _useState5[1];
2786
+ var _useState6 = React.useState(false),
2787
+ isShowPassword = _useState6[0],
2788
+ setIsShowPassword = _useState6[1];
2785
2789
 
2786
2790
  React.useEffect(function () {
2787
2791
  document.title = TITLE;
@@ -2885,7 +2889,8 @@ var useLogin = function useLogin() {
2885
2889
  try {
2886
2890
  var _temp6 = _catch(function () {
2887
2891
  return Promise.resolve(getGoogleClientId()).then(function (res) {
2888
- setGoogleClientId(res.data);
2892
+ setGoogleClientId(res.data.googleClientId);
2893
+ setGoogleRecaptchaId(res.data.googleCaptchaId);
2889
2894
  });
2890
2895
  }, function (err) {
2891
2896
  var _err$response2, _err$response2$data;
@@ -3020,7 +3025,8 @@ var useLogin = function useLogin() {
3020
3025
  setInfoUser: setInfoUser,
3021
3026
  submitLogin: submitLogin,
3022
3027
  setIsLoginGoogle: setIsLoginGoogle,
3023
- googleClientId: googleClientId
3028
+ googleClientId: googleClientId,
3029
+ googleRecaptchaId: googleRecaptchaId
3024
3030
  };
3025
3031
  };
3026
3032
 
@@ -3209,9 +3215,6 @@ var BlockLogin = function BlockLogin(_ref) {
3209
3215
  }
3210
3216
  }, [executeRecaptcha]);
3211
3217
  var handleVerify = React.useCallback(function () {}, []);
3212
- console.log({
3213
- googleClientId: googleClientId
3214
- });
3215
3218
 
3216
3219
  var onSuccessGoogle = function onSuccessGoogle(res) {
3217
3220
  if (!!(res !== null && res !== void 0 && res.accessToken)) {
@@ -3708,7 +3711,8 @@ var Login = function Login(props) {
3708
3711
 
3709
3712
  var _useLogin = useLogin(),
3710
3713
  defaultInfo = _useLogin.defaultInfo,
3711
- userLogin = _useLogin.userLogin;
3714
+ userLogin = _useLogin.userLogin,
3715
+ googleRecaptchaId = _useLogin.googleRecaptchaId;
3712
3716
 
3713
3717
  React.useEffect(function () {
3714
3718
  isLogin && (document.title = LOGIN_TITLE);
@@ -3724,9 +3728,9 @@ var Login = function Login(props) {
3724
3728
  md: 12,
3725
3729
  xs: 12,
3726
3730
  className: "d-flex justify-content-center h-100 align-items-center"
3727
- }, React__default.createElement(reactGoogleRecaptchaV3.GoogleReCaptchaProvider, {
3731
+ }, !!googleRecaptchaId && React__default.createElement(reactGoogleRecaptchaV3.GoogleReCaptchaProvider, {
3728
3732
  useRecaptchaNet: true,
3729
- reCaptchaKey: GOOGLE_RECAPTCHA_KEY,
3733
+ reCaptchaKey: googleRecaptchaId,
3730
3734
  scriptProps: {
3731
3735
  async: true,
3732
3736
  defer: true,