fix: convert login form submit listener to named onclick doLogin() — prevents Rocket Loader race condition on form submit

This commit is contained in:
2026-06-01 03:47:23 +00:00
parent c115ed4bb8
commit a06b57ea7f
+4 -5
View File
@@ -649,8 +649,8 @@ body::after{
<p>Just A Rather Very Intelligent System</p>
<form class="login-form" id="loginForm">
<input type="text" id="loginUser" placeholder="IDENTIFICATION" autocomplete="username" value="myron"/>
<input type="password" id="loginPass" placeholder="ACCESS CODE" autocomplete="current-password"/>
<button type="submit">INITIALIZE SYSTEM</button>
<input type="password" id="loginPass" placeholder="ACCESS CODE" autocomplete="current-password" onkeydown="if(event.key==='Enter')doLogin()"/>
<button type="button" onclick="doLogin()">INITIALIZE SYSTEM</button>
<div id="loginError"></div>
</form>
</div>
@@ -979,8 +979,7 @@ function updateClock() {
}
// ── LOGIN ─────────────────────────────────────────────────────────────
document.getElementById('loginForm').addEventListener('submit', async (e) => {
e.preventDefault();
async function doLogin() {
const user = document.getElementById('loginUser').value;
const pass = document.getElementById('loginPass').value;
const errEl = document.getElementById('loginError');
@@ -1000,7 +999,7 @@ document.getElementById('loginForm').addEventListener('submit', async (e) => {
} catch(err) {
errEl.textContent = 'CONNECTION FAILED';
}
});
}
function showApp(name, greeting, silent = false) {
document.getElementById('loginScreen').style.display = 'none';