This commit is contained in:
Evelyn Sucitro 2025-12-01 12:32:54 +07:00
parent 8823161f87
commit 4b44f9a7b5

12
Logout.js Normal file
View File

@ -0,0 +1,12 @@
async function logout() {
// Panggil PHP untuk hapus session (opsional)
await fetch("http://localhost/Kelompok06_2048/Logout.php", {
method: "POST"
});
// Hapus token & username dari localStorage
localStorage.removeItem("authToken");
localStorage.removeItem("username");
window.location.href = "Homepage.html";
}