Add user management with admin and viewer roles

- data/users.json store; existing single account migrates to first admin
- Roles: admin (settings, import, users) and viewer (read-only, own password)
- Live role/disabled lookup; per-user session epoch so password changes,
  resets and disabling sign that user out everywhere
- Login brute-force lockout (5 fails -> 5 min), constant-time unknown-user check
- /api/users CRUD with last-admin and self-lockout safeguards
- Account page (own password + admin user management); role-aware header
- Min password length 8; recovery token resets the primary admin and clears lockouts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nate EmmertandClaude Sonnet 5.5 committed 2026-10-15 12:34:13 -04:00
1 parent b3f1061f5c
commit 1566ac2897
7 files changed
+442 -93

No files matched your search

+1
View File
@@ -48,6 +48,7 @@ button:hover { opacity: 0.88; }
</div>
<script>
if (location.search.includes('error=1')) document.getElementById('err').style.display = 'block';
if (location.search.includes('error=2')) { const e = document.getElementById('err'); e.textContent = 'Too many failed attempts. Try again in a few minutes.'; e.style.display = 'block'; }
if (location.search.includes('recovered=1')) document.getElementById('ok').style.display = 'block';
</script>
</body>