diff --git a/backend/app/database.py b/backend/app/database.py index 672f336..ab666ac 100644 --- a/backend/app/database.py +++ b/backend/app/database.py @@ -4,7 +4,7 @@ from sqlalchemy.orm import DeclarativeBase from app.config import settings -engine = create_async_engine(settings.database_url, echo=False) +engine = create_async_engine(settings.database_url, echo=False, pool_pre_ping=True, pool_recycle=1800) AsyncSessionLocal = async_sessionmaker(engine, expire_on_commit=False) diff --git a/frontend/about.html b/frontend/about.html index 6243271..9a25d77 100644 --- a/frontend/about.html +++ b/frontend/about.html @@ -21,6 +21,19 @@
+ The name is a blend of two things: Bourbon and the Fibonacci sequence. +
++ The Fibonacci sequence — 1, 1, 2, 3, 5, 8, 13… — is a series where each number is the sum of the two before it. It goes on forever, building endlessly on everything that came before it. An infinity bottle works the same way: every addition builds on the blend that already exists, and the result is something that compounds in complexity over time with no defined end. +
++ Just as no two numbers in the sequence are the same, no two infinity bottles are alike — and just like the sequence itself, yours will never truly be finished. +
+diff --git a/frontend/js/api.js b/frontend/js/api.js index 42c6b3f..d620222 100644 --- a/frontend/js/api.js +++ b/frontend/js/api.js @@ -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); diff --git a/frontend/js/auth.js b/frontend/js/auth.js index bc08f89..6d1fdb7 100644 --- a/frontend/js/auth.js +++ b/frontend/js/auth.js @@ -26,7 +26,11 @@ const Auth = (() => { window.location.href = '/login.html'; } - function isLoggedIn() { return !!getToken(); } + function isLoggedIn() { + const payload = _decodePayload(); + if (!payload) return false; + return payload.exp * 1000 > Date.now(); + } function requireAuth() { if (!isLoggedIn()) {