Files
securelens-backend/app/schemas/auth.py
2026-04-07 18:13:43 +05:30

29 lines
564 B
Python

from datetime import datetime
from pydantic import BaseModel, EmailStr, Field
class RegisterRequest(BaseModel):
email: EmailStr
username: str = Field(..., min_length=3, max_length=100)
password: str = Field(..., min_length=8, max_length=128)
class LoginRequest(BaseModel):
email: EmailStr
password: str
class TokenResponse(BaseModel):
access_token: str
token_type: str = "bearer"
class UserResponse(BaseModel):
id: str
email: str
username: str
created_at: datetime
model_config = {"from_attributes": True}