c69c028028
- scripts/seed.go: idempotent demo data per §11.11 (make seed) - forgot/reset password: SMTP-gated, one-shot TTL tokens, uniform responses against enumeration, sessions revoked on reset; login page link + pages - profile hover cards on [data-user-card] elements (§11.13) - keyboard shortcuts: g b/m/t/h navigation, / focuses search (§10) - bulk archive endpoint (§11.9) - hand-written OpenAPI 3.1 covering §6, served at /api/docs + yaml download - make backup / make restore (mongodump archive via the mongo container) - README: quick start, demo data, runbook, breaker/job operations, working Caddy + nginx reverse-proxy samples (WS block, client_max_body_size), documented later-stubs (§11.24) - smoke.sh now exercises register → logout → login → me → board → pages Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
717 B
JavaScript
20 lines
717 B
JavaScript
import { api } from '/static/js/api.js';
|
|
|
|
document.getElementById('forgot-form').addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
const errorBox = document.getElementById('error');
|
|
const okBox = document.getElementById('ok');
|
|
errorBox.textContent = '';
|
|
okBox.textContent = '';
|
|
try {
|
|
await api('POST', '/api/v1/auth/forgot', {
|
|
email: document.getElementById('email').value.trim(),
|
|
});
|
|
okBox.textContent = 'If an account with that email exists, a reset link is on its way.';
|
|
} catch (err) {
|
|
errorBox.textContent = err.code === 'smtp_disabled'
|
|
? 'Email is not configured on this server — ask an administrator to reset your password.'
|
|
: err.message;
|
|
}
|
|
});
|