Frontend guard shows login screen for unauthenticated users. Backend verifies Firebase ID tokens on all protected endpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14 lines
458 B
Python
14 lines
458 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from app.auth import get_current_user
|
|
from app.categorizer import categorize_pending
|
|
from app.database import get_db
|
|
|
|
router = APIRouter(tags=["categorize"])
|
|
|
|
|
|
@router.post("/api/categorize")
|
|
async def run_categorize(db: AsyncSession = Depends(get_db), _user: dict = Depends(get_current_user)):
|
|
count = await categorize_pending(db)
|
|
return {"categorized": count}
|