attempting to fix legacy user accounts with less than 20 characters.

This commit is contained in:
2026-05-22 15:34:23 +02:00
parent 6c6764202e
commit df312009b8
5 changed files with 28 additions and 8 deletions

View File

@@ -195,7 +195,7 @@
loginForm.addEventListener('submit', async (e) => {
e.preventDefault();
const formData = new FormData(loginForm);
if (formData.get('password') && formData.get('password').length < 20) {
if (!formData.get('password')) {
let errDiv = loginForm.querySelector('.flash-error');
if (!errDiv) { errDiv = document.createElement('div'); errDiv.className = 'flash-error'; loginForm.insertBefore(errDiv, loginForm.firstChild); }
errDiv.textContent = 'Invalid username or password.';

View File

@@ -220,7 +220,7 @@
<form class="login-form" method="post" action="/login" novalidate>
<h2 style="text-align: center; margin-bottom: 20px;">{{ t('auth.login_title') }}</h2>
<input type="text" name="username" placeholder="{{ t('auth.username_or_email') }}" autocomplete="off" required />
<input type="password" name="password" placeholder="{{ t('auth.password_placeholder_min') }}" autocomplete="off" required minlength="20" />
<input type="password" name="password" placeholder="{{ t('auth.password_placeholder_min') }}" autocomplete="off" required />
<p style="text-align: left; font-size: 0.9em; margin: 0;"><input type="checkbox" id="kmsi-modal" name="kmsi" />
<label for="kmsi-modal">{{ t('auth.stay_signed_in') }}</label>
</p>