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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user