firefox-email-mailcow-tempe.../Files/background.js
2025-02-20 00:16:47 +01:00

17 lines
467 B
JavaScript

async function login(username, password) {
const authHeader = "Basic " + btoa(username + ":" + password);
const response = await fetch("https://mail.pandem.fr/SOGo/so/session", {
method: "POST",
headers: {
"Authorization": authHeader,
"Content-Type": "application/json"
}
});
if (response.ok) {
return true; // Successfully logged in
} else {
return false; // Login failed
}
}