Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

google recaptcha

$
0
0

I have a provlem with the google reCaptcha v2. I have implementet it in a single Editor with this code:

    $( '#usr-signin' ).on( 'click', function() {
        auth
            .title( '<i class="fad fa-sign-in-alt txt-DarkCyan"></i> <span class="txt-DarkCyan bold">' + frmInfo.s_title + '</span>' )
            .buttons( [
                { label: frmInfo.login, action: function() { this.submit(
                    function() {
                        //window.location.href = 'index.php';
                    },
                    function( data ) {
                        this.close();
                        _PNotify( 'error', data['error']['errCode'] + ' ' + data['error']['errShort'], data['error']['icon'], data['error']['info'] );
                } ); }, className: 'btn-DarkCyan' },
                { label: frmInfo.cancel, action: function() { this.close(); } },
                { label: 'reset password', action: function() {

                } }
            ] ).edit();
        $( 'div.modal-dialog' ).removeClass( 'registration-dialog' ).addClass( 'login-dialog' );
        $( 'div.modal-content' ).removeClass( 'registration-content' ).addClass( 'login-content' );
        $( '<div class="g-recaptcha ml-100" data-sitekey="6LeD6g8Ucxxxxxxxxxxxxeded">' +
             '</div><script src="https://www.google.com/recaptcha/api.js"></script>' ).insertAfter( 'div.DTE_Field_Type_password' );
    } );

The captcha of google works, but if the submit button is pressed, the data will be sent no matter if captcha is true or not. How can I be sent before data check if the recaptcha is ok or not. Is there a simpler method? the security side does not help me here.

Andreas


Viewing all articles
Browse latest Browse all 3740