Fix bugs, data integrity, and cache busting
- models.py: add UniqueConstraint(user_id, date) to flock_history so duplicate flock entries for the same day are rejected at the DB level - main.py: v2.3 migration applies the new unique constraint to existing installs at startup - login.html: update register form minlength and placeholder from 6 to 10 characters to match backend; add specific 429 error message so rate- limited users see "Too many attempts — please wait a minute" instead of a generic failure - auth.js: update settings modal password input minlength from 6 to 10 - summary.js: fix CSV export truncation — pass limit=10000 so users with more than 500 days of data get a complete export; read chart border color from --green CSS variable instead of hardcoded hex - All HTML files: bump JS version params to ?v=4 so browsers discard cached copies of files changed across recent sessions (api.js, auth.js, dashboard.js, history.js, log.js, flock.js, budget.js, summary.js, admin.js) - .env.example: add password strength guidance for MySQL and admin vars Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:1rem">
|
||||
<label for="reg-password">Password</label>
|
||||
<input type="password" id="reg-password" autocomplete="new-password" required minlength="6" placeholder="min 6 characters">
|
||||
<input type="password" id="reg-password" autocomplete="new-password" required minlength="10" placeholder="min 10 characters">
|
||||
</div>
|
||||
<div class="form-group" style="margin-bottom:1.5rem">
|
||||
<label for="reg-confirm">Confirm Password</label>
|
||||
@@ -114,6 +114,7 @@
|
||||
body: JSON.stringify({ username, password }),
|
||||
});
|
||||
const data = await res.json();
|
||||
if (res.status === 429) { showError('login-msg', 'Too many attempts — please wait a minute and try again.'); return; }
|
||||
if (!res.ok) { showError('login-msg', data.detail || 'Login failed'); return; }
|
||||
localStorage.setItem('token', data.access_token);
|
||||
window.location.href = '/';
|
||||
|
||||
Reference in New Issue
Block a user