feat: redirect root path based on auth state
All checks were successful
check / check (push) Successful in 1m53s

/ now checks for an authenticated session:
- Authenticated users → 303 redirect to /sources
- Unauthenticated users → 303 redirect to /pages/login

Removes the old index page template rendering and formatUptime
helper (now dead code). Adds tests for both redirect cases.
This commit is contained in:
clawbot
2026-03-17 04:58:20 -07:00
parent f003ec7141
commit 9a0a6f88e3
4 changed files with 48 additions and 81 deletions

View File

@@ -65,7 +65,6 @@ func New(lc fx.Lifecycle, params HandlersParams) (*Handlers, error) {
// Parse all page templates once at startup
s.templates = map[string]*template.Template{
"index.html": parsePageTemplate("index.html"),
"login.html": parsePageTemplate("login.html"),
"profile.html": parsePageTemplate("profile.html"),
"sources_list.html": parsePageTemplate("sources_list.html"),