Explorar el Código

Update main.js

Add 'undefined' validation logic for 'Recaptcha reload'
RomanticCat hace 8 años
padre
commit
de4cc82e54
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      src/main/webapp/public/resources/js/main.js

+ 6 - 4
src/main/webapp/public/resources/js/main.js

@@ -400,10 +400,12 @@ PWM_MAIN.handleLoginFormSubmit = function(form, event) {
                 }
                 }
             };
             };
             PWM_MAIN.ajaxRequest(url,loadFunction,options);
             PWM_MAIN.ajaxRequest(url,loadFunction,options);
-            try {
-                grecaptcha.reset(); // reset the
-            } catch (e) {
-                console.log("error resetting the captcha: " + e)
+            if(typeof grecaptcha != 'undefined'){
+                try {
+                   grecaptcha.reset(); // reset the
+                } catch (e) {
+                    console.log("error resetting the captcha: " + e)
+                }
             }
             }
         }});
         }});
     });
     });