diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2021-09-13 12:55:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-13 12:55:14 -0700 |
commit | afe6d34ced84cb22868e26466f5e6928c5cd0d06 (patch) | |
tree | cfcfe23f270b2c1b332d2aab2d1eebf9950e4236 /src/components | |
parent | 1ed0a2f387ebe3f0d0aef590087e351b9534efc0 (diff) | |
parent | bbe7149d5814efc1d97613af107b12ba8f8a1c22 (diff) | |
download | homer-afe6d34ced84cb22868e26466f5e6928c5cd0d06.tar.gz homer-afe6d34ced84cb22868e26466f5e6928c5cd0d06.tar.zst homer-afe6d34ced84cb22868e26466f5e6928c5cd0d06.zip |
Merge pull request #258 from mcclurec/sso-compliant-fetch-calls
SSO Compliant Fetch Calls
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/AdGuardHome.vue | 4 | ||||
-rw-r--r-- | src/components/services/PaperlessNG.vue | 1 | ||||
-rw-r--r-- | src/components/services/PiHole.vue | 4 | ||||
-rw-r--r-- | src/components/services/Ping.vue | 6 |
4 files changed, 12 insertions, 3 deletions
diff --git a/src/components/services/AdGuardHome.vue b/src/components/services/AdGuardHome.vue index d4a2b89..9238060 100644 --- a/src/components/services/AdGuardHome.vue +++ b/src/components/services/AdGuardHome.vue | |||
@@ -51,7 +51,9 @@ export default { | |||
51 | }, | 51 | }, |
52 | methods: { | 52 | methods: { |
53 | fetchStatus: async function () { | 53 | fetchStatus: async function () { |
54 | this.status = await fetch(`${this.item.url}/control/status`).then( | 54 | this.status = await fetch(`${this.item.url}/control/status`, { |
55 | credentials: "include", | ||
56 | }).then( | ||
55 | (response) => response.json() | 57 | (response) => response.json() |
56 | ); | 58 | ); |
57 | }, | 59 | }, |
diff --git a/src/components/services/PaperlessNG.vue b/src/components/services/PaperlessNG.vue index 4fb31f8..af13317 100644 --- a/src/components/services/PaperlessNG.vue +++ b/src/components/services/PaperlessNG.vue | |||
@@ -59,6 +59,7 @@ export default { | |||
59 | } | 59 | } |
60 | const url = `${this.item.url}/api/documents/`; | 60 | const url = `${this.item.url}/api/documents/`; |
61 | this.api = await fetch(url, { | 61 | this.api = await fetch(url, { |
62 | credentials: "include", | ||
62 | headers: { | 63 | headers: { |
63 | Authorization: "Token " + this.item.apikey, | 64 | Authorization: "Token " + this.item.apikey, |
64 | }, | 65 | }, |
diff --git a/src/components/services/PiHole.vue b/src/components/services/PiHole.vue index 7042a7b..87f7090 100644 --- a/src/components/services/PiHole.vue +++ b/src/components/services/PiHole.vue | |||
@@ -64,7 +64,9 @@ export default { | |||
64 | methods: { | 64 | methods: { |
65 | fetchStatus: async function () { | 65 | fetchStatus: async function () { |
66 | const url = `${this.item.url}/api.php`; | 66 | const url = `${this.item.url}/api.php`; |
67 | this.api = await fetch(url) | 67 | this.api = await fetch(url, { |
68 | credentials: "include", | ||
69 | }) | ||
68 | .then((response) => response.json()) | 70 | .then((response) => response.json()) |
69 | .catch((e) => console.log(e)); | 71 | .catch((e) => console.log(e)); |
70 | }, | 72 | }, |
diff --git a/src/components/services/Ping.vue b/src/components/services/Ping.vue index 8a9b7a4..e693af4 100644 --- a/src/components/services/Ping.vue +++ b/src/components/services/Ping.vue | |||
@@ -50,7 +50,11 @@ export default { | |||
50 | methods: { | 50 | methods: { |
51 | fetchStatus: async function () { | 51 | fetchStatus: async function () { |
52 | const url = `${this.item.url}`; | 52 | const url = `${this.item.url}`; |
53 | fetch(url, { method: "HEAD", cache: "no-cache" }) | 53 | fetch(url, { |
54 | method: "HEAD", | ||
55 | cache: "no-cache", | ||
56 | credentials: "include", | ||
57 | }) | ||
54 | .then((response) => { | 58 | .then((response) => { |
55 | if (!response.ok) { | 59 | if (!response.ok) { |
56 | throw Error(response.statusText); | 60 | throw Error(response.statusText); |