admin fix
This commit is contained in:
@@ -363,8 +363,8 @@
|
||||
<div id="login-form">
|
||||
<div class="fg"><label>Email alebo meno</label><input type="text" id="l-email" placeholder="admin" /></div>
|
||||
<div class="fg"><label>Heslo</label><input type="password" id="l-pass" placeholder="••••••••" onkeydown="if(event.key==='Enter')doLogin()" /></div>
|
||||
<button class="btn-primary" onclick="doLogin()">Prihlásiť sa</button>
|
||||
<button class="forgot-link" onclick="showReset()">Zabudol som heslo</button>
|
||||
<button class="btn-primary" onclick="doLogin()">Prihlásiť sa</button>
|
||||
<div class="err" id="l-err"></div>
|
||||
</div>
|
||||
|
||||
@@ -543,8 +543,19 @@ async function doLogin() {
|
||||
method:'POST', headers:{'Content-Type':'application/json'},
|
||||
body: JSON.stringify({ email: v('l-email'), password: v('l-pass') })
|
||||
});
|
||||
if (res.ok) { const d = await res.json(); saveAuth(d); showApp(); }
|
||||
else err.textContent = await res.text();
|
||||
if (res.ok) {
|
||||
const d = await res.json();
|
||||
saveAuth(d);
|
||||
// Reset všetkých auth inputov
|
||||
['l-email','l-pass','r-email','r-newpass','r-newpass2','r-code'].forEach(id => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) el.value = '';
|
||||
});
|
||||
document.getElementById('l-err').textContent = '';
|
||||
document.getElementById('r-err').textContent = '';
|
||||
showLogin();
|
||||
showApp();
|
||||
} else err.textContent = await res.text();
|
||||
}
|
||||
|
||||
// Zaslanie kódu — aktivuje sa keď bude mailová služba funkčná
|
||||
|
||||
Reference in New Issue
Block a user