X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcomponents%2Fservices%2FPaperlessNG.vue;h=af13317859e1f7e1117cf29bcf9ec02adf9b9ce6;hb=fd1871508559eb44a8ef32b03b637d8565e19b6a;hp=c4f50eb15cf7284083a4f6aad3bd5826bbd4d073;hpb=24229b541181c8ef0813b015c5589e9a34269cb0;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/src/components/services/PaperlessNG.vue b/src/components/services/PaperlessNG.vue index c4f50eb..af13317 100644 --- a/src/components/services/PaperlessNG.vue +++ b/src/components/services/PaperlessNG.vue @@ -52,20 +52,23 @@ export default { if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing var apikey = this.item.apikey; if (!apikey) { - console.error("apikey is not present in config.yml for the paperless entry!"); + console.error( + "apikey is not present in config.yml for the paperless entry!" + ); return; } const url = `${this.item.url}/api/documents/`; this.api = await fetch(url, { - headers: { - "Authorization": "Token " + this.item.apikey - } - }) - .then(function(response) { + credentials: "include", + headers: { + Authorization: "Token " + this.item.apikey, + }, + }) + .then(function (response) { if (!response.ok) { - throw new Error("Not 2xx response") + throw new Error("Not 2xx response"); } else { - return response.json() + return response.json(); } }) .catch((e) => console.log(e));