13 lines
366 B
Python
Raw Normal View History

from fastapi import APIRouter, Depends
from ..auth import get_current_user
from ..models import User_Pydantic, User
router = APIRouter(
prefix="/users",
tags=["users"],
)
@router.get("/me", response_model=User_Pydantic)
async def read_users_me(current_user: User = Depends(get_current_user)):
return await User_Pydantic.from_tortoise_orm(current_user)