29 lines
521 B
Python
29 lines
521 B
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from pydantic import BaseModel, EmailStr, ConfigDict
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
email: str
|
|
password: str
|
|
|
|
|
|
class TokenResponse(BaseModel):
|
|
access_token: str
|
|
refresh_token: str
|
|
token_type: str = "bearer"
|
|
|
|
|
|
class RefreshRequest(BaseModel):
|
|
refresh_token: str
|
|
|
|
|
|
class UserResponse(BaseModel):
|
|
id: uuid.UUID
|
|
email: str
|
|
is_active: bool
|
|
created_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|