fix: digest auth changed to basic

Digest auth not working on ios #99
This commit is contained in:
Yurii
2024-12-02 06:26:03 +03:00
parent 1bb9b61017
commit 43fd095714
8 changed files with 106 additions and 86 deletions

View File

@@ -380,13 +380,18 @@
console.log(newSettings);
}
let parameters = { cache: 'no-cache' };
let parameters = {
method: "GET",
cache: "no-cache",
credentials: "include"
};
if (modified) {
parameters.method = "POST";
parameters.body = JSON.stringify(newSettings);
}
const response = await fetch('/api/settings', parameters);
const response = await fetch("/api/settings", parameters);
if (!response.ok) {
throw new Error('Response not valid');
}
@@ -424,7 +429,11 @@
// vars
try {
const response = await fetch('/api/vars', { cache: 'no-cache' });
const response = await fetch("/api/vars", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error('Response not valid');
}
@@ -540,7 +549,11 @@
// sensors
try {
const response = await fetch("/api/sensors?detailed=1", { cache: "no-cache" });
const response = await fetch("/api/sensors?detailed=1", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error("Response not valid");
}

View File

@@ -170,7 +170,11 @@
setTimeout(async function onLoadPage() {
try {
const response = await fetch('/api/info', { cache: 'no-cache' });
const response = await fetch("/api/info", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error('Response not valid');
}

View File

@@ -199,7 +199,11 @@
};
try {
const response = await fetch('/api/network/settings', { cache: 'no-cache' });
const response = await fetch("/api/network/settings", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error('Response not valid');
}

View File

@@ -194,7 +194,11 @@
const templateNode = container.querySelector("#template");
try {
const response = await fetch("/api/sensors", { cache: "no-cache" });
const response = await fetch("/api/sensors", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error("Response not valid");
}
@@ -287,7 +291,11 @@
}
try {
const response = await fetch(sensorForm.action, { cache: "no-cache" });
const response = await fetch(sensorForm.action, {
cache: "no-cache",
credentials: "include"
});
if (response.status != 200) {
return;
}

View File

@@ -808,7 +808,11 @@
};
try {
const response = await fetch('/api/settings', { cache: 'no-cache' });
const response = await fetch("/api/settings", {
cache: "no-cache",
credentials: "include"
});
if (!response.ok) {
throw new Error('Response not valid');
}