@router.get("/{id}/files")
async def get_user_files(
id: int,
user: UserS = Depends(get_current_user),
user_service: UserService = Depends(user_service),
) -> UserFiles | None:
if id == user.id:
user_files = await user_service.get_files(user.id)
return user_files
In this example code, I expect that the user will pass the id of the person he wants to receive, but does this make sense if I already get his id through the JWT token and then check if they converge
1