{"size": 988, "ext": "js", "max_stars_repo_path": "public/dist/js/usuario/login.js", "max_stars_repo_name": "JorgeCoronelG/SICOAE_AppWeb", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/dist/js/usuario/login.js", "max_issues_repo_name": "JorgeCoronelG/SICOAE_AppWeb", "max_issues_repo_issues_event_min_datetime": "2021-03-10T04:07:46.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-06T09:55:32.000Z", "max_forks_repo_path": "public/dist/js/usuario/login.js", "max_forks_repo_name": "JorgeCoronelG/SICOAE_AppWeb", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 38.0, "max_line_length": 127, "alphanum_fraction": 0.5060728745}
$('#form-login').submit(function(e){
    e.preventDefault();
    $.ajax({
        url: '/login',
        method: 'post',
        data: $(this).serialize(),
        dataType: 'json',
        beforeSend: function(){
            $('#load-login').removeClass('d-none');
            $('#btn-login').addClass('d-none');
        },
        success: function(data){
            location.reload();
        },
        error: function(jqXHR){
            let errors = jqXHR.responseJSON.errors;
            if(errors.hasOwnProperty('correo')) $('#error-correo').html(errors['correo'][0]); else $('#error-correo').html('');
            if(errors.hasOwnProperty('clave')) $('#error-clave').html(errors['clave'][0]); else $('#error-clave').html('');
            if(errors.hasOwnProperty('login')) toastr.error(errors['login'][0], 'Error');
        },
        complete: function(){
            $('#btn-login').removeClass('d-none');
            $('#load-login').addClass('d-none');
        }
    });
});