dak.c2s/backend/app/main.py
CCS Admin 518de3da27 feat: auth system — login, register, refresh, MFA, domain whitelist
Add complete authentication layer:
- Pydantic v2 schemas for auth requests/responses and user representation
- Auth service with login (account locking, MFA), registration (invitation
  tokens + domain whitelist), token management, MFA setup/activation, and
  password change
- FastAPI router with 8 endpoints: login, register, refresh, logout,
  mfa/setup, mfa/verify, change-password, me
- Router registered in main.py under /api/auth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:46:04 +00:00

26 lines
603 B
Python

# backend/app/main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.auth import router as auth_router
from app.config import get_settings
settings = get_settings()
app = FastAPI(title=settings.APP_NAME, docs_url="/docs")
app.add_middleware(
CORSMiddleware,
allow_origins=settings.CORS_ORIGINS.split(","),
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# --- Routers ---
app.include_router(auth_router, prefix="/api/auth", tags=["auth"])
@app.get("/api/health")
def health_check():
return {"status": "ok"}