This commit is contained in:
Gabriel Peron 2025-02-20 00:22:01 +01:00
parent d91df9dad3
commit f025794a27

View file

@ -4,6 +4,7 @@ async function login(username, password) {
const authHeader = "Basic " + btoa(username + ":" + password);
try {
console.log("Sending request to SOGo API...");
const response = await fetch("https://mail.pandem.fr/SOGo/so/session", {
method: "POST",
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) {
console.log("Login successful");
return true;
} 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;
}
} catch (error) {