js destroy session

This commit is contained in:
Zeni Kim 2024-10-29 12:44:51 -05:00
parent 0b2abac628
commit 19c24593fe
5 changed files with 115 additions and 64 deletions

View file

@ -1 +1,14 @@
console.log("Start Goffee app");
console.log("Start Goffee app");
let elem = document.querySelector('#signout');
if (elem) {
document.getElementById("signout").onclick = (_event) => {
fetch('/signout').then(response => response.json())
.then(data => {
if (data['message'] == "signed out successfully") {
// Refresh the page
location.reload();
}
})
};
}