Add log out support

This commit is contained in:
kittentm 2026-02-11 04:48:16 +01:00
commit ba0814eecd
9 changed files with 132 additions and 56 deletions

21
logout.js Normal file
View file

@ -0,0 +1,21 @@
$(document).ready(function () {
const form = $("#logout-form");
if (typeof CONFIG === 'undefined') {
alert("CRITICAL ERROR: config.js not loaded before logout.js");
return;
}
const apiBase = CONFIG.API_BASE_URL;
const targetAction = apiBase.replace(/\/$/, "") + "/spfn/logout";
$("#logout_frontend_origin").val(window.location.origin);
form.attr("action", targetAction);
console.log("Form action set to: " + targetAction);
form.submit(function(e) {
alert("Submitting to: " + $(this).attr("action"));
const submitBtn = $(":submit", this);
submitBtn.prop("disabled", true).css("opacity", "0.5");
});
});