This commit is contained in:
Elliot SecOps 2026-01-30 11:44:52 -05:00 committed by GitHub
commit ace6dc220c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,6 +145,18 @@ export function connectGateway(host: GatewayHost) {
host.connected = false; host.connected = false;
// Code 1012 = Service Restart (expected during config saves, don't show as error) // Code 1012 = Service Restart (expected during config saves, don't show as error)
if (code !== 1012) { if (code !== 1012) {
// PR Fix: Prompt for password on auth failure (1008/4008) instead of just showing error
if ((code === 1008 || code === 4008) && reason.includes("password")) {
const newPass = window.prompt("Gateway Authentication Required\n\nPlease enter your gateway password:");
if (newPass) {
host.password = newPass;
// Clear error and retry immediately
host.lastError = null;
// Defer reconnect to let the close handler finish
window.setTimeout(() => connectGateway(host), 100);
return;
}
}
host.lastError = `disconnected (${code}): ${reason || "no reason"}`; host.lastError = `disconnected (${code}): ${reason || "no reason"}`;
} }
}, },