Files
marquiz-metrics/app/api/v1/schemas/auth.py
13orlov 8047844ad4
Some checks failed
continuous-integration/drone/push Build is failing
feat(auth): Add endpoint to get user info by token
2025-08-24 22:19:33 +01:00

17 lines
611 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from pydantic import BaseModel, Field
class TokenRequest(BaseModel):
"""Схема запроса для получения токена."""
code: str = Field(..., description="Временный код авторизации от Яндекса")
class TokenResponse(BaseModel):
"""Схема ответа с токеном доступа."""
access_token: str
token_type: str
class UserInfoResponse(BaseModel):
"""Схема ответа с информацией о пользователе Яндекса."""
id: str
login: str
display_name: str
default_email: str