diff --git a/Logout.js b/Logout.js new file mode 100644 index 0000000..808ca8e --- /dev/null +++ b/Logout.js @@ -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"; +} \ No newline at end of file