Skip to content

fix: make /search public to stop spurious 401s#7

Merged
dhighwayman merged 1 commit into
masterfrom
fix/public-search
May 31, 2026
Merged

fix: make /search public to stop spurious 401s#7
dhighwayman merged 1 commit into
masterfrom
fix/public-search

Conversation

@dhighwayman

Copy link
Copy Markdown
Contributor

Problem

The new item-name typeahead fires GET /search/?q= on every keystroke. The route was auth-guarded, so it sent the cached Google ID token — which is short-lived (~1h) and not auto-refreshed. Once expired, every search returned 401 Unauthorized (as seen in the browser console hitting api.curatedli.st/search/).

Fix

Make /search/ public. External-catalog search (Open Library / TMDB / iTunes) exposes no private data, and the TMDB API key stays server-side regardless — so the auth middleware added no real protection here, only failure modes. This is a one-line route change (drop TokenAuthMiddleware from the /search group); list/user routes stay guarded.

🤖 Generated with Claude Code

The item-name typeahead fires on every keystroke and was hitting the
auth-guarded /search route with the cached Google ID token, which is
short-lived (~1h) and not refreshed — so once it expired, search 401'd.

External-catalog search (Open Library / TMDB / iTunes) exposes no private
data and the TMDB key stays server-side regardless, so authentication
added no protection here — only failure modes. Drop the auth middleware
from the /search group.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dhighwayman dhighwayman merged commit 2fa0a32 into master May 31, 2026
2 checks passed
@dhighwayman dhighwayman deleted the fix/public-search branch May 31, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant