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>
|
<p>Just A Rather Very Intelligent System</p>
|
||||||
<form class="login-form" id="loginForm">
|
<form class="login-form" id="loginForm">
|
||||||
<input type="text" id="loginUser" placeholder="IDENTIFICATION" autocomplete="username" value="myron"/>
|
<input type="text" id="loginUser" placeholder="IDENTIFICATION" autocomplete="username" value="myron"/>
|
||||||
<input type="password" id="loginPass" placeholder="ACCESS CODE" autocomplete="current-password"/>
|
<input type="password" id="loginPass" placeholder="ACCESS CODE" autocomplete="current-password" onkeydown="if(event.key==='Enter')doLogin()"/>
|
||||||
<button type="submit">INITIALIZE SYSTEM</button>
|
<button type="button" onclick="doLogin()">INITIALIZE SYSTEM</button>
|
||||||
<div id="loginError"></div>
|
<div id="loginError"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -979,8 +979,7 @@ function updateClock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── LOGIN ─────────────────────────────────────────────────────────────
|
// ── LOGIN ─────────────────────────────────────────────────────────────
|
||||||
document.getElementById('loginForm').addEventListener('submit', async (e) => {
|
async function doLogin() {
|
||||||
e.preventDefault();
|
|
||||||
const user = document.getElementById('loginUser').value;
|
const user = document.getElementById('loginUser').value;
|
||||||
const pass = document.getElementById('loginPass').value;
|
const pass = document.getElementById('loginPass').value;
|
||||||
const errEl = document.getElementById('loginError');
|
const errEl = document.getElementById('loginError');
|
||||||
@@ -1000,7 +999,7 @@ document.getElementById('loginForm').addEventListener('submit', async (e) => {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
errEl.textContent = 'CONNECTION FAILED';
|
errEl.textContent = 'CONNECTION FAILED';
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
function showApp(name, greeting, silent = false) {
|
function showApp(name, greeting, silent = false) {
|
||||||
document.getElementById('loginScreen').style.display = 'none';
|
document.getElementById('loginScreen').style.display = 'none';
|
||||||
|
|||||||
Reference in New Issue
Block a user