Moved endpoints to routers
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m12s
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m12s
This commit is contained in:
17
app/routers/playlist.py
Normal file
17
app/routers/playlist.py
Normal 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!"}
|
||||
Reference in New Issue
Block a user