Merge pull request #17175 from garylab/bugfix/api-config

Bugfix: Add verify token from headers also for /api/config endpoint
This commit is contained in:
Tim Jaeryang Baek 2025-09-03 13:39:25 +04:00 committed by GitHub
commit e5829572ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1649,8 +1649,18 @@ async def list_tasks_by_chat_id_endpoint(
@app.get("/api/config")
async def get_app_config(request: Request):
user = None
if "token" in request.cookies:
token = None
auth_header = request.headers.get("Authorization")
if auth_header:
cred = get_http_authorization_cred(auth_header)
if cred:
token = cred.credentials
if not token and "token" in request.cookies:
token = request.cookies.get("token")
if token:
try:
data = decode_token(token)
except Exception as e: