Ensure expired sessions for ajax calls get immediately redirected.

This commit is contained in:
Junior 2025-05-06 19:45:16 -04:00
parent 7e3d12db84
commit 1ef310a2b7

View File

@ -22,7 +22,10 @@ function getFolderContents() {
url : 'ajax/getfoldercontents.php',
dataType : 'json',
success : function(data, stat, jqo) {
if ( !data.validated ) redirectToLogin();
if ( !data.validated ) {
redirectToLogin();
return;
}
curpath = data.compath;
updatePathNavigator();
data.contents.forEach(function(entry, index) {
@ -52,8 +55,11 @@ function changeFolder(name, path) {
data : {path: path},
dataType : 'json',
success : function(data, stat, jqo) {
if ( !data.validated ) {
redirectToLogin();
return;
}
console.log(data.message);
if ( !data.validated ) redirectToLogin();
curpath = path;
parentpath = data.parentpath;
foldername = data.foldername;
@ -69,7 +75,10 @@ function updateCurrentPage() {
data : {page: currentPage},
dataType : 'json',
success : function(data, stat, jqo) {
if ( !data.validated ) redirectToLogin();
if ( !data.validated ) {
redirectToLogin();
return;
}
console.log(data.message);
}
});
@ -89,7 +98,10 @@ function showComic(comic, name) {
data : {comic: comic},
dataType : 'json',
success : function(data, stat, jqo) {
if ( !data.validated ) redirectToLogin();
if ( !data.validated ) {
redirectToLogin();
return;
}
// Clear out the debug DIV and start the fancybox.
$("#debug").html("");
lightbox = SimpleLightbox.open({