diff --git a/src/main/resources/templates/welcome.html b/src/main/resources/templates/welcome.html
index ab0a093..67b3131 100644
--- a/src/main/resources/templates/welcome.html
+++ b/src/main/resources/templates/welcome.html
@@ -59,8 +59,17 @@
Digital signing
const fileNameText = document.querySelector("#file-name");
const exampleDocument = document.querySelector("#example-document");
+ const csrfToken = document.querySelector('#csrftoken').content;
+ const csrfHeaderName = document.querySelector('#csrfheadername').content;
+
document.querySelector("#webeid-logout-button").addEventListener("click", async () => {
- await fetch("/logout");
+ await fetch("/logout", {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ [csrfHeaderName]: csrfToken
+ }
+ });
window.location.href = "/";
});
@@ -68,9 +77,6 @@ Digital signing
window.location.href = "/sign/download";
});
- const csrfToken = document.querySelector('#csrftoken').content;
- const csrfHeaderName = document.querySelector('#csrfheadername').content;
-
const lang = new URLSearchParams(window.location.search).get("lang") || "en";
signButton.addEventListener("click", async () => {