Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: Add /auth/csrf-token endpoint for API access

LearningCircuit2f745ee032ba
diff --git a/src/local_deep_research/web/auth/routes.py b/src/local_deep_research/web/auth/routes.py
index 08e7fe06bc..c08680a72f 100644
--- a/src/local_deep_research/web/auth/routes.py
+++ b/src/local_deep_research/web/auth/routes.py
@@ -27,6 +27,22 @@ auth_bp = Blueprint("auth", __name__, url_prefix="/auth")
session_manager = SessionManager()
+@auth_bp.route("/csrf-token", methods=["GET"])
+def get_csrf_token():
+ """
+ Get CSRF token for API requests.
+ Returns the current CSRF token for the session.
+ This endpoint makes it easy for API clients to get the CSRF token
+ programmatically without parsing HTML.
+ """
+ from flask_wtf.csrf import generate_csrf
+
+ # Generate or get existing CSRF token for this session
+ token = generate_csrf()
+
+ return jsonify({"csrf_token": token}), 200
+
+
@auth_bp.route("/login", methods=["GET", "POST"])
def login():
"""