Moved endpoints to routers
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m12s

This commit is contained in:
2025-05-22 09:34:20 -05:00
parent c1e3a6ef26
commit 5ee6cb4be4
5 changed files with 138 additions and 124 deletions

17
app/routers/playlist.py Normal file
View File

@@ -0,0 +1,17 @@
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!"}