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

@ -6,6 +6,7 @@
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="styles.css" />
<script src="/assets/general.js"></script>
<script src="/config.js"></script>
</head>
<body>
<div id="header-container"></div>

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.rank');
if (friendButton) {
friendButton.classList.add('active');