mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
fix: convert login form submit listener to named onclick doLogin() — prevents Rocket Loader race condition on form submit
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user