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

@@ -652,7 +652,7 @@ against a misbehaving sender).
| Method | Path | Description |
| ------ | --------------------------- | ----------- |
| `GET` | `/` | Web UI index page (server-rendered) |
| `GET` | `/` | Root redirect (authenticated → `/sources`, unauthenticated → `/pages/login`) |
| `GET` | `/.well-known/healthcheck` | Health check (JSON: status, uptime, version) |
| `GET` | `/s/*` | Static file serving (embedded CSS, JS) |
| `ANY` | `/webhook/{uuid}` | Webhook receiver endpoint (accepts all methods) |