We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd88dd9 commit 8c3576bCopy full SHA for 8c3576b
1 file changed
src/blueapi/client/rest.py
@@ -312,13 +312,11 @@ def _request_and_deserialize(
312
313
def run_blocking(self, req: TaskRequest):
314
url = self._ws_address().unicode_string().removesuffix("/") + "/run_plan"
315
- with connect(
316
- url,
317
- additional_headers={
318
- "Cookie": "Authorization=Bearer cook",
319
- "Authorization": "Bearer head",
320
- },
321
- ) as ws:
+ headers = {}
+ if self._session_manager:
+ auth = self._session_manager.get_valid_access_token()
+ headers["Authorization"] = f"Bearer {auth}"
+ with connect(url, additional_headers=headers) as ws:
322
ws.send(req.model_dump_json())
323
for message in ws:
324
event = TypeAdapter(AnyEvent).validate_json(message)
0 commit comments