V1.7
This commit is contained in:
parent
d91df9dad3
commit
f025794a27
1 changed files with 5 additions and 2 deletions
|
@ -4,6 +4,7 @@ async function login(username, password) {
|
||||||
const authHeader = "Basic " + btoa(username + ":" + password);
|
const authHeader = "Basic " + btoa(username + ":" + password);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log("Sending request to SOGo API...");
|
||||||
const response = await fetch("https://mail.pandem.fr/SOGo/so/session", {
|
const response = await fetch("https://mail.pandem.fr/SOGo/so/session", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -12,13 +13,15 @@ async function login(username, password) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Response status:", response.status); // Debugging
|
console.log("Response received:", response);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
console.log("Login successful");
|
console.log("Login successful");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
console.log("Login failed");
|
console.log("Login failed with status:", response.status, response.statusText);
|
||||||
|
const errorText = await response.text();
|
||||||
|
console.log("Response body:", errorText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in a new issue