From a05f0db74532ae4bf0f8697da61c491f1fd421ea Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 30 Jul 2022 00:19:34 +0200 Subject: [PATCH] disconnect click --- web/html/home.html | 2 +- web/js/home.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/html/home.html b/web/html/home.html index 4d85ecd..e0b85c0 100644 --- a/web/html/home.html +++ b/web/html/home.html @@ -94,7 +94,7 @@ diff --git a/web/js/home.js b/web/js/home.js index dd5f6d8..9f37a3a 100644 --- a/web/js/home.js +++ b/web/js/home.js @@ -36,3 +36,10 @@ instance.get("users", {withCredentials: true, params :{ page:0, nbPages: nbPages }); +document.getElementById("signout").addEventListener("click", function(){ + instance.delete("token" , {withCredentials:true}).then(function(response){ + if(response.status == 200){ + location.href="/" + } + }); +});