15 lines
442 B
Python

from fastapi import APIRouter, Depends
from ..models import users
from ..dependencies import get_current_active_user
from typing import Annotated
router = APIRouter()
@router.get("/users/", tags=["users"])
async def read_users():
return [{"username":"toto"}]
@router.get("/users/me", response_model=users.User)
async def read_users_me(current_user: Annotated[users.User, Depends(get_current_active_user)]):
return current_user