mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: add SSE progress endpoint to public paths
The /api/v1/jobs/ endpoint was blocked by auth middleware. EventSource doesn't support custom headers so auth tokens can't be sent. The jobId is a random UUID (unguessable capability token), same security model as the download endpoint.
This commit is contained in:
@@ -388,7 +388,7 @@ function extractToken(request: FastifyRequest): string | null {
|
||||
|
||||
// ── Auth middleware ────────────────────────────────────────────────
|
||||
|
||||
const PUBLIC_PATHS = ["/api/v1/health", "/api/v1/config/", "/api/auth/", "/api/docs", "/api/v1/download/"];
|
||||
const PUBLIC_PATHS = ["/api/v1/health", "/api/v1/config/", "/api/auth/", "/api/docs", "/api/v1/download/", "/api/v1/jobs/"];
|
||||
|
||||
function isPublicRoute(url: string): boolean {
|
||||
// Non-API routes are public (SPA static files — auth is handled client-side)
|
||||
|
||||
Reference in New Issue
Block a user