mirror of
https://github.com/bastienwirtz/homer.git
synced 2024-11-07 16:54:00 +01:00
Merge pull request #258 from mcclurec/sso-compliant-fetch-calls
SSO Compliant Fetch Calls
This commit is contained in:
commit
afe6d34ced
@ -51,7 +51,9 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchStatus: async function () {
|
||||
this.status = await fetch(`${this.item.url}/control/status`).then(
|
||||
this.status = await fetch(`${this.item.url}/control/status`, {
|
||||
credentials: "include",
|
||||
}).then(
|
||||
(response) => response.json()
|
||||
);
|
||||
},
|
||||
|
@ -59,6 +59,7 @@ export default {
|
||||
}
|
||||
const url = `${this.item.url}/api/documents/`;
|
||||
this.api = await fetch(url, {
|
||||
credentials: "include",
|
||||
headers: {
|
||||
Authorization: "Token " + this.item.apikey,
|
||||
},
|
||||
|
@ -64,7 +64,9 @@ export default {
|
||||
methods: {
|
||||
fetchStatus: async function () {
|
||||
const url = `${this.item.url}/api.php`;
|
||||
this.api = await fetch(url)
|
||||
this.api = await fetch(url, {
|
||||
credentials: "include",
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.catch((e) => console.log(e));
|
||||
},
|
||||
|
@ -50,7 +50,11 @@ export default {
|
||||
methods: {
|
||||
fetchStatus: async function () {
|
||||
const url = `${this.item.url}`;
|
||||
fetch(url, { method: "HEAD", cache: "no-cache" })
|
||||
fetch(url, {
|
||||
method: "HEAD",
|
||||
cache: "no-cache",
|
||||
credentials: "include",
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.ok) {
|
||||
throw Error(response.statusText);
|
||||
|
Loading…
Reference in New Issue
Block a user