JS fixes for when we get a 419
This commit is contained in:
parent
ee556582d2
commit
4767eb3a4f
17
public/js/custom.js
vendored
17
public/js/custom.js
vendored
@ -42,8 +42,21 @@ $(document).ready(function() {
|
|||||||
}).done(function(html) {
|
}).done(function(html) {
|
||||||
$('.main-content').empty().append(html);
|
$('.main-content').empty().append(html);
|
||||||
|
|
||||||
}).fail(function() {
|
}).fail(function(item) {
|
||||||
alert('Failed');
|
switch(item.status) {
|
||||||
|
case 404:
|
||||||
|
$('.main-content').empty().append(item.responseText);
|
||||||
|
break;
|
||||||
|
case 419:
|
||||||
|
alert('Session has expired, reloading the page and try again...');
|
||||||
|
location.reload();
|
||||||
|
break;
|
||||||
|
case 500:
|
||||||
|
$('.main-content').empty().append(item.responseText);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
alert(item.status+': Well that didnt work?');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -80,7 +80,7 @@
|
|||||||
$('.main-content').empty().append(html);
|
$('.main-content').empty().append(html);
|
||||||
|
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
//alert('Failed');
|
alert('Well that didnt work?');
|
||||||
});
|
});
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
Loading…
Reference in New Issue
Block a user