tracks/internal
Claude db538f6dee
Fix authentication: redirect to login page instead of showing JSON errors
The auth middleware was returning JSON error messages ("No authentication token
provided") for web UI requests, which displayed as plain text in the browser.

Changes:
- Added isAPIRequest check to detect if request is for /api/* or web UI
- For web UI requests without auth: redirect to /login (HTTP 302)
- For API requests without auth: return JSON error (HTTP 401)
- Applied same logic for all auth failure scenarios (no token, invalid token,
  invalid claims, user not found)

This fixes the issue where users see JSON errors in the browser instead of
being properly redirected to the login page when authentication fails.
2025-11-05 13:26:24 +00:00
..
config Simplify database support to SQLite only 2025-11-05 11:23:40 +00:00
database Add default admin user and admin-only user creation 2025-11-05 11:35:36 +00:00
handlers Add inline context creation when creating todos 2025-11-05 13:21:04 +00:00
middleware Fix authentication: redirect to login page instead of showing JSON errors 2025-11-05 13:26:24 +00:00
models Fix polymorphic tagging and add test script 2025-11-05 10:59:26 +00:00
services Add default admin user and admin-only user creation 2025-11-05 11:35:36 +00:00