12 lines
350 B
JavaScript
12 lines
350 B
JavaScript
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";
|
|
} |