Coverage for src/kwai/api/v1/auth/endpoints/user.py: 86%
7 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module that implements all user endpoints."""
3from fastapi import APIRouter, Depends
5from kwai.api.dependencies import get_current_user
6from kwai.modules.identity.users.user import UserEntity
9router = APIRouter()
12@router.get(
13 "/user",
14 summary="Get the id of the current user",
15 responses={
16 200: {"description": "Ok."},
17 401: {"description": "Not authorized"},
18 },
19)
20def get(user: UserEntity = Depends(get_current_user)):
21 """Get the current user."""
22 return {"id": str(user.uuid)}