Coverage for kwai/api/v1/auth/endpoints/user.py: 86%

7 statements  

« prev     ^ index     » next       coverage.py v7.3.0, created at 2023-09-05 17:55 +0000

1"""Module that implements all user endpoints.""" 

2 

3from fastapi import APIRouter, Depends 

4 

5from kwai.api.dependencies import get_current_user 

6from kwai.modules.identity.users.user import UserEntity 

7 

8router = APIRouter() 

9 

10 

11@router.get("/user") 

12def get(user: UserEntity = Depends(get_current_user)): 

13 """Get the current user.""" 

14 return {"id": str(user.uuid)}