Admin Panel: - User Detail Modal with full profile info - Bulk tier upgrade for multiple users - User export to CSV - Price Alerts overview tab - Domain Health Check trigger - Email Test functionality - Scheduler Status with job info and last runs - Activity Log for admin actions - Blog management tab with CRUD Blog System: - BlogPost model with full content management - Public API: list, featured, categories, single post - Admin API: create, update, delete, publish/unpublish - Frontend blog listing page with categories - Frontend blog detail page with styling - View count tracking OAuth: - Google OAuth integration - GitHub OAuth integration - OAuth callback handling - Provider selection on login/register Other improvements: - Domain checker with check_all_domains function - Admin activity logging - Breadcrumbs component - Toast notification component - Various UI/UX improvements
47 lines
990 B
Python
47 lines
990 B
Python
"""Authentication schemas."""
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class UserCreate(BaseModel):
|
|
"""Schema for user registration."""
|
|
email: EmailStr
|
|
password: str = Field(..., min_length=8, max_length=100)
|
|
name: Optional[str] = Field(None, max_length=100)
|
|
|
|
|
|
class UserLogin(BaseModel):
|
|
"""Schema for user login."""
|
|
email: EmailStr
|
|
password: str
|
|
|
|
|
|
class UserResponse(BaseModel):
|
|
"""Schema for user response."""
|
|
id: int
|
|
email: str
|
|
name: Optional[str]
|
|
is_active: bool
|
|
is_verified: bool
|
|
is_admin: bool = False
|
|
created_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class Token(BaseModel):
|
|
"""Schema for JWT token response."""
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_in: int
|
|
|
|
|
|
class TokenData(BaseModel):
|
|
"""Schema for token payload data."""
|
|
user_id: Optional[int] = None
|
|
email: Optional[str] = None
|
|
|