Added error if captcha isn't completed
authorRemixDev <deezloaderremix@gmail.com>
Wed, 10 Apr 2019 19:44:28 +0000 (21:44 +0200)
committerRemixDev <deezloaderremix@gmail.com>
Wed, 10 Apr 2019 19:44:28 +0000 (21:44 +0200)
app/public/js/frontend.js

index acfdfeb5c5466a38ee2900341ffac8719f475b55..8a01a5c406894c93f9ec1609b397388d7b4ace3a 100644 (file)
@@ -53,9 +53,16 @@ $('#modal_login_btn_login').click(function () {
        clearInterval(timer)
                                var username = $('#modal_login_input_username').val()
                                var password = $('#modal_login_input_password').val()
+                               var captchaResponse = $('#modal_login_input_captchaResponse').val()
+                               if (captchaResponse == ""){
+                                       $('#login-res-text').text("Error: Captcha wasn't solved.")
+                                       setTimeout(function(){$('#login-res-text').text("")},3000)
+                                       $('#modal_login_btn_login').attr("disabled", false)
+                                       $('#modal_login_btn_login').html("Log in")
+                                       return
+                               }
                                localStorage.setItem('autologin_email', username)
                                //Send to the software
-                               var captchaResponse = $('#modal_login_input_captchaResponse').val()
                          socket.emit('login', username, password, captchaResponse)
       }
     }, 500);