Spaces:
Runtime error
Runtime error
File size: 838 Bytes
f3997d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | from pydantic import BaseModel, EmailStr
from typing import Optional
from datetime import datetime
class UserCreate(BaseModel):
"""Schema for user registration."""
email: EmailStr
password: str
name: Optional[str] = None
class UserLogin(BaseModel):
"""Schema for user login."""
email: EmailStr
password: str
class GoogleAuthRequest(BaseModel):
"""Schema for Google OAuth."""
code: str
class UserResponse(BaseModel):
"""Schema for user response."""
id: str
email: str
name: Optional[str]
is_admin: bool = False
created_at: datetime
class Config:
from_attributes = True
class TokenResponse(BaseModel):
"""Schema for authentication token response."""
access_token: str
refresh_token: str
token_type: str = "bearer"
user: UserResponse
|