Fix stale DB connections, add Why Bourbonacci section, harden auth

- Add pool_pre_ping and pool_recycle to prevent lost connection errors on idle pool
- Add Why Bourbonacci card to about page
- Redirect to login on 401 in API layer
- Check JWT expiry in isLoggedIn instead of just token presence

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 21:37:04 -07:00
parent a9de081a8a
commit 866c2e0bed
4 changed files with 26 additions and 2 deletions
+7
View File
@@ -26,6 +26,13 @@ const API = (() => {
const data = await res.json().catch(() => null);
if (res.status === 401) {
localStorage.removeItem('bb_token');
localStorage.removeItem('bb_user');
window.location.href = '/login.html';
return;
}
if (!res.ok) {
const msg = data?.detail || `HTTP ${res.status}`;
throw new Error(Array.isArray(msg) ? msg.map(e => e.msg).join(', ') : msg);