feat: add session auth api

This commit is contained in:
hailin
2026-07-01 14:05:40 +08:00
parent 7c4b66b832
commit 18319c1fc8
5 changed files with 220 additions and 0 deletions

View File

@@ -77,6 +77,11 @@ CORS_ALLOWED_ORIGINS = os.getenv(
"CORS_ALLOWED_ORIGINS",
"http://localhost:5173",
).split(",")
CORS_ALLOW_CREDENTIALS = True
CSRF_TRUSTED_ORIGINS = os.getenv(
"CSRF_TRUSTED_ORIGINS",
"http://localhost:5173,http://127.0.0.1:5173",
).split(",")
CELERY_BROKER_URL = os.getenv("CELERY_BROKER_URL", "redis://localhost:6379/0")
CELERY_RESULT_BACKEND = os.getenv("CELERY_RESULT_BACKEND", "redis://localhost:6379/1")

View File

@@ -2,12 +2,14 @@ from django.contrib import admin
from django.urls import path
from ninja import NinjaAPI
from apps.accounts.api import router as accounts_router
from apps.audit.api import router as audit_router
from apps.solutions.api import router as solutions_router
from apps.system.api import router as system_router
from apps.tickets.api import router as tickets_router
api = NinjaAPI(title="AI Ticket Platform API", version="0.1.0")
api.add_router("/accounts", accounts_router)
api.add_router("/system", system_router)
api.add_router("/audit", audit_router)
api.add_router("/tickets", tickets_router)