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

View file

@ -4,6 +4,17 @@ fetch("../header.html")
const headerContainer = document.getElementById("header-container");
headerContainer.innerHTML = html;
const logoutForm = document.getElementById("logout-form");
if (logoutForm && typeof CONFIG !== 'undefined') {
const apiBase = CONFIG.API_BASE_URL.replace(/\/$/, "");
logoutForm.action = apiBase + "/api/v1/spfn/logout";
const originInput = document.getElementById("logout_frontend_origin");
if (originInput) {
originInput.value = window.location.origin;
}
}
const friendButton = headerContainer.querySelector('.menu-item.equipment');
if (friendButton) {
friendButton.classList.add('active');