Radar is blank on public location pages (embeds authenticated radar endpoint) #123

Closed
opened 2026-07-22 15:59:24 +00:00 by claude-bot · 0 comments
Contributor

The public location page (/api/locations/{id}/public) renders a blank Radar panel for unauthenticated visitors.

Cause: the page embeds <img src="/api/locations/{id}/radar?animated=true">, but that endpoint (app/api/alerts.py::get_radar) requires Depends(require_user) + can_view_location_with_db. An unauthenticated viewer's image request gets a 302 redirect to login ({"detail":"Found"}) instead of the PNG, so the image fails to load → blank. The radar fetching/caching itself works fine (confirmed radar_KLSX_animated success in prod logs).

Fix: add a public_enabled-gated, unauthenticated GET /api/locations/{id}/public/radar route (mirroring how the public page itself is gated), and repoint the template <img> at it. Image is disk-cached (radar_cache_minutes), so repeat public hits don't reach upstream.

Reported by the operator viewing the public page for "Charter - 13736 Riverport".

The public location page (`/api/locations/{id}/public`) renders a **blank Radar panel** for unauthenticated visitors. **Cause:** the page embeds `<img src="/api/locations/{id}/radar?animated=true">`, but that endpoint (`app/api/alerts.py::get_radar`) requires `Depends(require_user)` + `can_view_location_with_db`. An unauthenticated viewer's image request gets a **302 redirect to login** (`{"detail":"Found"}`) instead of the PNG, so the image fails to load → blank. The radar fetching/caching itself works fine (confirmed `radar_KLSX_animated` success in prod logs). **Fix:** add a `public_enabled`-gated, unauthenticated `GET /api/locations/{id}/public/radar` route (mirroring how the public page itself is gated), and repoint the template `<img>` at it. Image is disk-cached (`radar_cache_minutes`), so repeat public hits don't reach upstream. Reported by the operator viewing the public page for "Charter - 13736 Riverport".
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/WeatherBot#123
No description provided.