feat: add homepage auto-redirect for logged-in users

- Add JavaScript to check for valid JWT token on homepage load
- Auto-redirect to /bookshelf if user is already logged in
- Shows login/register form if not authenticated
- Improves UX by taking logged-in users directly to bookshelf

Implementation:
- Fetch /api/auth/profile with stored token
- On success, redirect to /bookshelf
- On failure, silently stay on homepage
- Runs on DOMContentLoaded for fast execution
This commit is contained in:
2026-01-29 15:52:34 -05:00
parent d9ca3d5a65
commit 703daeb32f
2 changed files with 26 additions and 2 deletions
File diff suppressed because one or more lines are too long