disconnect click

This commit is contained in:
2022-07-30 00:19:34 +02:00
parent 614a852fe6
commit a05f0db745
2 changed files with 8 additions and 1 deletions

View File

@@ -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="/"
}
});
});