Files
iptv-manager-service/app/routers/playlist.py
Stefano 5ee6cb4be4
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m12s
Moved endpoints to routers
2025-05-22 09:34:20 -05:00

17 lines
593 B
Python

from fastapi import APIRouter, Depends
from app.auth.dependencies import get_current_user
from app.models.auth import CognitoUser
router = APIRouter(
prefix="/playlist",
tags=["playlist"]
)
@router.get("/protected",
summary="Protected endpoint for authenticated users")
async def protected_route(user: CognitoUser = Depends(get_current_user)):
"""
Protected endpoint that requires authentication for all users.
If the user is authenticated, returns success message.
"""
return {"message": f"Hello {user.username}, you have access to support resources!"}