forked from spacebar/SplatNet
Add log out support
This commit is contained in:
parent
82794e6f22
commit
ba0814eecd
9 changed files with 132 additions and 56 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue