From 62ec40cfb0de7978dfaed972843984b7a2bdb85c Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Wed, 17 Dec 2025 19:30:14 -0500 Subject: [PATCH] change the password check --- samy.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/samy.js b/samy.js index 6831440..4824184 100644 --- a/samy.js +++ b/samy.js @@ -223,11 +223,8 @@ document.addEventListener("DOMContentLoaded", () => { // ======================================================================= async function fetchSites() { const pwdInput = document.getElementById("Password"); - const pwd = pwdInput?.value; - if (!pwd) { - alert("Please enter the password."); - return; - } + const pwd = (pwdInput?.value ?? ""); // allow empty string + const dropdown = document.getElementById("dattoDropdown"); dropdown.innerHTML = ''; @@ -256,7 +253,8 @@ async function fetchSites() { console.error(e); dropdown.innerHTML = ''; - alert("Failed to fetch sites. Check password and try again."); + alert("Failed to fetch sites. Check password or confirm your public IP is allowlisted."); + } } @@ -268,11 +266,8 @@ let allPrinters = []; // POST /getprinters with password from Devices tab async function fetchPrinters() { const pwdInput = document.getElementById("PrinterPassword"); - const pwd = pwdInput?.value; - if (!pwd) { - alert("Please enter the printer password."); - return; - } + + const pwd = (pwdInput?.value ?? ""); // allow blank const clientContainer = document.getElementById("printerClientContainer"); const listContainer = document.getElementById("printerListContainer"); @@ -324,7 +319,8 @@ async function fetchPrinters() { dropdown.innerHTML = ''; } - alert("Failed to fetch printers. Check password and try again."); + alert("Failed to fetch printers. Check password or confirm your public IP is allowlisted."); + } }