@@ -263,16 +263,15 @@ class SearchResponse(BaseModel):
263263
264264@router .get ("/transcripts" , response_model = Page [GetTranscriptMinimal ])
265265async def transcripts_list (
266- user : Annotated [Optional [auth .UserInfo ], Depends (auth .current_user_optional )],
266+ user : Annotated [
267+ Optional [auth .UserInfo ], Depends (auth .current_user_optional_if_public_mode )
268+ ],
267269 source_kind : SourceKind | None = None ,
268270 room_id : str | None = None ,
269271 search_term : str | None = None ,
270272 change_seq_from : int | None = None ,
271273 sort_by : Literal ["created_at" , "change_seq" ] | None = None ,
272274):
273- if not user and not settings .PUBLIC_MODE :
274- raise HTTPException (status_code = 401 , detail = "Not authenticated" )
275-
276275 user_id = user ["sub" ] if user else None
277276
278277 # Default behavior preserved: sort_by=None → "-created_at"
@@ -307,13 +306,10 @@ async def transcripts_search(
307306 from_datetime : SearchFromDatetimeParam = None ,
308307 to_datetime : SearchToDatetimeParam = None ,
309308 user : Annotated [
310- Optional [auth .UserInfo ], Depends (auth .current_user_optional )
309+ Optional [auth .UserInfo ], Depends (auth .current_user_optional_if_public_mode )
311310 ] = None ,
312311):
313312 """Full-text search across transcript titles and content."""
314- if not user and not settings .PUBLIC_MODE :
315- raise HTTPException (status_code = 401 , detail = "Not authenticated" )
316-
317313 user_id = user ["sub" ] if user else None
318314
319315 if from_datetime and to_datetime and from_datetime > to_datetime :
@@ -346,11 +342,10 @@ async def transcripts_search(
346342@router .post ("/transcripts" , response_model = GetTranscriptWithParticipants )
347343async def transcripts_create (
348344 info : CreateTranscript ,
349- user : Annotated [Optional [auth .UserInfo ], Depends (auth .current_user_optional )],
345+ user : Annotated [
346+ Optional [auth .UserInfo ], Depends (auth .current_user_optional_if_public_mode )
347+ ],
350348):
351- if not user and not settings .PUBLIC_MODE :
352- raise HTTPException (status_code = 401 , detail = "Not authenticated" )
353-
354349 user_id = user ["sub" ] if user else None
355350 transcript = await transcripts_controller .add (
356351 info .name ,
0 commit comments