From aebc32e5de42bcd76f4af1b415afb33a3ec40690 Mon Sep 17 00:00:00 2001 From: Sergio Vera Date: Sun, 14 Jul 2024 20:31:29 +0200 Subject: [PATCH] Brought back JS session expiration check --- internal/webserver/embedded/js/xh-error-check.js | 5 +---- internal/webserver/embedded/views/users/edit.html | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/webserver/embedded/js/xh-error-check.js b/internal/webserver/embedded/js/xh-error-check.js index 485bb665..2ac93c9b 100644 --- a/internal/webserver/embedded/js/xh-error-check.js +++ b/internal/webserver/embedded/js/xh-error-check.js @@ -8,10 +8,7 @@ document.body.addEventListener('htmx:afterRequest', function (evt) { // Server error with response contents, equivalent to htmx:responseError const xhr = evt.detail.xhr; if (xhr.status == "403") { - location.reload() - } - if (xhr.status == "400") { - return + return location.reload() } console.warn("Server error", evt.detail) diff --git a/internal/webserver/embedded/views/users/edit.html b/internal/webserver/embedded/views/users/edit.html index 29983714..0fdaa791 100644 --- a/internal/webserver/embedded/views/users/edit.html +++ b/internal/webserver/embedded/views/users/edit.html @@ -103,4 +103,4 @@ - \ No newline at end of file + \ No newline at end of file