forked from extern/homer
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: {
|
methods: {
|
||||||
fetchStatus: async function () {
|
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()
|
(response) => response.json()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -59,6 +59,7 @@ export default {
|
|||||||
}
|
}
|
||||||
const url = `${this.item.url}/api/documents/`;
|
const url = `${this.item.url}/api/documents/`;
|
||||||
this.api = await fetch(url, {
|
this.api = await fetch(url, {
|
||||||
|
credentials: "include",
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: "Token " + this.item.apikey,
|
Authorization: "Token " + this.item.apikey,
|
||||||
},
|
},
|
||||||
|
@ -64,7 +64,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
fetchStatus: async function () {
|
fetchStatus: async function () {
|
||||||
const url = `${this.item.url}/api.php`;
|
const url = `${this.item.url}/api.php`;
|
||||||
this.api = await fetch(url)
|
this.api = await fetch(url, {
|
||||||
|
credentials: "include",
|
||||||
|
})
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.catch((e) => console.log(e));
|
.catch((e) => console.log(e));
|
||||||
},
|
},
|
||||||
|
@ -50,7 +50,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
fetchStatus: async function () {
|
fetchStatus: async function () {
|
||||||
const url = `${this.item.url}`;
|
const url = `${this.item.url}`;
|
||||||
fetch(url, { method: "HEAD", cache: "no-cache" })
|
fetch(url, {
|
||||||
|
method: "HEAD",
|
||||||
|
cache: "no-cache",
|
||||||
|
credentials: "include",
|
||||||
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw Error(response.statusText);
|
throw Error(response.statusText);
|
||||||
|
Loading…
Reference in New Issue
Block a user