Logout
This commit is contained in:
parent
8823161f87
commit
4b44f9a7b5
12
Logout.js
Normal file
12
Logout.js
Normal 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";
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user