1
0
Fork 0
forked from goffee/cup

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();
}
})
};
}

View file

@ -4,8 +4,10 @@
<body>
<div class="container">
<div class="row">
{{template "content_dropdown" .ContentDropdown}}
{{template "page_card" .PageCard}}
{{ define "page_card_content" }}
<img class="goffeelogo"src="/public/img/goffee.png" alt="Goffee logo" />
{{ end }}
</div>