Repository navigation
Auth Fixes - #32
Auth Fixes#32
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adjusts authentication and proxy middleware behavior to allow unauthenticated access to specific “image proxy” API routes (primarily Jellyfin image/artwork endpoints), likely to support public/proxied deployments without requiring a user session for artwork retrieval.
Changes:
- Allowed unauthenticated access to multiple image-related API routes in the proxy middleware (
src/proxy.ts). - Removed the session requirement from the Jellyfin image route handler so it can serve images without a logged-in session (
src/app/api/jellyfin/image/[id]/route.ts).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/proxy.ts |
Expands the unauthenticated allowlist to include Jellyfin/Radarr/Sonarr image proxy routes. |
src/app/api/jellyfin/image/[id]/route.ts |
Removes session gating for Jellyfin item image fetches so artwork can be retrieved publicly. |
Suppressed comments (1)
src/app/api/jellyfin/image/[id]/route.ts:24
- Since this endpoint is now reachable without a session, unbounded
width/heightquery params can be used to force expensive upstream resizes (or very large responses). Consider clamping to sane max values and requiring positive finite numbers before forwarding them to Jellyfin.
const { searchParams } = new URL(req.url)
const rawType = searchParams.get("type") || "Primary"
const type = ALLOWED_TYPES.has(rawType) ? rawType : "Primary"
const width = searchParams.get("width")
const height = searchParams.get("height")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if ( | ||
| pathname.startsWith("/_next") || | ||
| pathname.startsWith("/api/auth/login") || | ||
| pathname.startsWith("/api/jellyfin/image") || | ||
| pathname.startsWith("/api/jellyfin/chapter-image") || | ||
| pathname.startsWith("/api/jellyfin/trickplay") || | ||
| pathname.startsWith("/api/radarr/MediaCover") || | ||
| pathname.startsWith("/api/sonarr/MediaCover") || | ||
| PUBLIC_PATHS.some((path) => pathname === path || pathname.startsWith("/public")) | ||
| ) { |
| import { authenticate } from "@/lib/jellyfin" | ||
| import { getSession } from "@/lib/auth" | ||
| import { env } from "@/lib/env" | ||
|
|
|
Review complete. Full diff analyzed (2 files, +6/-9) against the codebase and AGENTS.md conventions. OpenCode Severity Report - PR #32SummaryFULL REVIEW MODE: CRITICAL: 1 | HIGH: 1 | MEDIUM: 1 | LOW: 2 | INFO: 1 IssuesCRITICAL
HIGH
MEDIUM
LOW
INFO
|
- Added @base-ui/react, ogl, shadcn, and tw-animate-css to dependencies. - Updated globals.css to include new styles and imports. - Implemented Scanner component for a full-screen WebGL shader background in the login page. - Enhanced API routes for jellyfin, radarr, and sonarr to include session validation. - Updated proxy logic to allow public image access based on environment variables. - Created components.json for shadcn configuration. - Added validation for media cover paths in API routes.
This pull request updates the image proxy and authentication logic for the Jellyfin API and adjusts the proxy middleware to allow unauthenticated access to certain image endpoints. The main goal is to permit public image requests for specific routes, likely to improve compatibility with proxies or public deployments.
API authentication changes:
GEThandler insrc/app/api/jellyfin/image/[id]/route.ts, so image requests no longer require a user session. (src/app/api/jellyfin/image/[id]/route.tsL21-L27)getSessionimport fromsrc/app/api/jellyfin/image/[id]/route.ts. (src/app/api/jellyfin/image/[id]/route.tsL4)Proxy middleware updates:
src/proxy.tsto allow unauthenticated access to image proxy routes, including/api/jellyfin/image,/api/jellyfin/chapter-image,/api/jellyfin/trickplay,/api/radarr/MediaCover, and/api/sonarr/MediaCover.