fix: store csrf_token in cookies dict

This commit is contained in:
root 2026-03-29 22:08:01 +00:00
parent 2225ffea01
commit ed86ad63b1
3 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 18, "execution_count": 20,
"id": "f28552f1-618c-4853-92e2-566554a2de2c", "id": "f28552f1-618c-4853-92e2-566554a2de2c",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@ -12,7 +12,7 @@
"True" "True"
] ]
}, },
"execution_count": 18, "execution_count": 20,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -28,7 +28,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 19, "execution_count": 21,
"id": "953d142e-a575-41b7-927d-8cd1546d2747", "id": "953d142e-a575-41b7-927d-8cd1546d2747",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [

View File

@ -292,7 +292,7 @@ class KworkClient:
# Get CSRF token from response for API requests # Get CSRF token from response for API requests
csrf_token = response_data.get("csrftoken") or cookies.get("csrf_user_token") csrf_token = response_data.get("csrftoken") or cookies.get("csrf_user_token")
if csrf_token: if csrf_token:
self._cookies["csrftoken"] = csrf_token cookies["csrftoken"] = csrf_token
# Create new client with token # Create new client with token
return cls(token=web_token, cookies=cookies, timeout=timeout) return cls(token=web_token, cookies=cookies, timeout=timeout)