1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

Refactor WebAuthn Javascript code

This commit is contained in:
Frédéric Guillot 2023-11-06 17:28:25 +00:00
parent a75256bed5
commit 2b8342fcd5
9 changed files with 226 additions and 218 deletions

View file

@ -9,7 +9,7 @@ class RequestBuilder {
body: null,
headers: new Headers({
"Content-Type": "application/json",
"X-Csrf-Token": this.getCsrfToken()
"X-Csrf-Token": getCsrfToken()
})
};
}
@ -29,15 +29,6 @@ class RequestBuilder {
return this;
}
getCsrfToken() {
let element = document.querySelector("body[data-csrf-token]");
if (element !== null) {
return element.dataset.csrfToken;
}
return "";
}
execute() {
fetch(new Request(this.url, this.options)).then((response) => {
if (this.callback) {