samedi 3 mars 2018

TokenMismatchException in VerifyCsrfToken.php line 46 on one ajax request on done of another

I get TokenMismatchException when I make another ajax request from done of first one in jquery in laravel-5.0. I tried different Browsers but it yields to same output.

  var setting = {
                    url : 'http://localhost/enduewitapi/login',
                    type : 'GET',
                    dataType : 'json',
                    data : data,
                };
                setting.done = function(data,textStatus,jqXHR){
                    var dataOne = {
                        dataOne : data
                    };
                    gen_ajax(sessionPath, 'POST', dataOne,
                        function(data, textStatus, jqXHR){
                            alert("Second ajax request successfull");
                        },
                        function(jqXHR, textStatus, errorThrown){
                            alert("second ajax request failed");
                            console.log(errorThrown);
                        },
                        function(jqXHR,textStatus){}
                    );
                },
                setting.fail = function(jqXHR,textStatus,errorThrown){
                    alert(jqXHR.status);
                    console.log(errorThrown);
                },
                setting.always = function(jqXHR,textStatus){}
                Apiajax(setting);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire