add logout button to user page

This commit is contained in:
Mystikfluu
2022-06-16 16:03:26 +02:00
parent 824eb99851
commit b41d420ce1
3 changed files with 13 additions and 2 deletions
+6
View File
@@ -54,6 +54,12 @@ function setCookie(cname, cvalue, exdays) {
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function logout() {
localStorage.setItem("priv_key","")
localStorage.setItem("decryption_key","")
location.assign('/logout')
}
async function setuser() {
if(getCookie("priv_key") != "") {
localStorage.setItem("priv_key",getCookie("priv_key"))