fix auth errors and add primigenial paper trash

This commit is contained in:
DioCrafts
2025-03-24 16:47:42 +01:00
parent 838ae6e0d4
commit 38b0e9594b
58 changed files with 3701 additions and 135 deletions
+8 -1
View File
@@ -264,14 +264,21 @@ async function login(username, password) {
};
}
// Add better error handling with timeout
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
const response = await fetch(LOGIN_ENDPOINT, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ username, password })
body: JSON.stringify({ username, password }),
signal: controller.signal
});
clearTimeout(timeoutId);
console.log(`Login response status: ${response.status}`);
// Handle both successful and error responses