POST /api/compare missing auth gate -- returns 500 instead of 401 #11

Closed
opened 2026-04-27 17:28:12 +00:00 by TopherMayor · 0 comments
Owner

Description

Unauthenticated POST requests to /api/compare return HTTP 500 instead of 401 Unauthorized.

Expected

POST /api/compare (no session) -> 401 Unauthorized

Actual

POST /api/compare (no session) -> 500 Internal Server Error

Fix

Add auth check at the top of the compare handler before attempting DB operations.

Severity: High - security + error handling.

## Description Unauthenticated POST requests to `/api/compare` return HTTP 500 instead of 401 Unauthorized. ## Expected ``` POST /api/compare (no session) -> 401 Unauthorized ``` ## Actual ``` POST /api/compare (no session) -> 500 Internal Server Error ``` ## Fix Add auth check at the top of the compare handler before attempting DB operations. ## Severity: High - security + error handling.
TopherMayor added the bug label 2026-04-27 17:28:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TopherMayor/comparaison#11